From: Yu Watanabe Date: Tue, 17 Sep 2019 12:29:23 +0000 (+0900) Subject: network: add missing link->network checks X-Git-Tag: v244~320^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1b0b42e48303134731e017a108c6c334ef5f4c8;p=platform%2Fupstream%2Fsystemd.git network: add missing link->network checks When the function is called, no network file may be assigned to the link. --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index f1aeb72..46d55f6 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2393,9 +2393,9 @@ static int link_drop_foreign_config(Link *link) { continue; if (link_address_is_dynamic(link, address)) { - if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP)) + if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP)) continue; - } else if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC)) + } else if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC)) continue; if (link_is_static_address_configured(link, address)) { @@ -2435,11 +2435,11 @@ static int link_drop_foreign_config(Link *link) { in_addr_equal(AF_INET6, &route->dst, &(union in_addr_union) { .in6 = {{{ 0xff,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }}} })) continue; - if (route->protocol == RTPROT_STATIC && + if (route->protocol == RTPROT_STATIC && link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC)) continue; - if (route->protocol == RTPROT_DHCP && + if (route->protocol == RTPROT_DHCP && link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP)) continue;