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>
This commit is contained in:
parent
8ce499665b
commit
e7047059b1
1 changed files with 4 additions and 3 deletions
|
@ -1205,9 +1205,10 @@ static bool dhcpv4_parse_options(struct net_pkt *pkt,
|
|||
log_server.sin_family = AF_INET;
|
||||
log_backend_net_set_ip((struct sockaddr *)&log_server);
|
||||
|
||||
#ifdef CONFIG_LOG_BACKEND_NET_AUTOSTART
|
||||
log_backend_net_start();
|
||||
#endif
|
||||
if (IS_ENABLED(CONFIG_LOG_BACKEND_NET_AUTOSTART) &&
|
||||
!IS_ENABLED(CONFIG_NET_CONFIG_SETTINGS)) {
|
||||
log_backend_net_start();
|
||||
}
|
||||
|
||||
NET_DBG("options_log_server: %s", net_sprint_ipv4_addr(&log_server));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue