Skip to content

Commit e704705

Browse files
maass-hamburgkartben
authored andcommitted
logging: backend: net: avoid early enabling
Avoid early enabling of the syslog backend in the the dhcpv4 options parser. When CONFIG_NET_IPV4_ACD is enabled, the assigned ip address has not been checked, when the other dhcpv4 options are parsed, this would lead to the syslog backend being enabled before the src ip address is valid, so we get lots of warnings about dropd packets, this fixes it at least on start. We will still get the warnings, when the iface goes down and then up later. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent 8ce4996 commit e704705

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

subsys/net/lib/dhcpv4/dhcpv4.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,9 +1205,10 @@ static bool dhcpv4_parse_options(struct net_pkt *pkt,
12051205
log_server.sin_family = AF_INET;
12061206
log_backend_net_set_ip((struct sockaddr *)&log_server);
12071207

1208-
#ifdef CONFIG_LOG_BACKEND_NET_AUTOSTART
1209-
log_backend_net_start();
1210-
#endif
1208+
if (IS_ENABLED(CONFIG_LOG_BACKEND_NET_AUTOSTART) &&
1209+
!IS_ENABLED(CONFIG_NET_CONFIG_SETTINGS)) {
1210+
log_backend_net_start();
1211+
}
12111212

12121213
NET_DBG("options_log_server: %s", net_sprint_ipv4_addr(&log_server));
12131214

0 commit comments

Comments
 (0)