From: Yu Watanabe Date: Mon, 1 Aug 2022 18:32:55 +0000 (+0900) Subject: network: fix possible NULL-pointer dereference X-Git-Tag: v252-rc1~546^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fb5fae933132431d7ca5dd2865f42e1907e6fae;p=thirdparty%2Fsystemd.git network: fix possible NULL-pointer dereference --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 269f69ec21c..c8df554cd62 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -74,10 +74,13 @@ bool link_ipv6_enabled(Link *link) { if (!socket_ipv6_is_supported()) return false; - if (link->network->bond) + if (link->iftype == ARPHRD_CAN) return false; - if (link->iftype == ARPHRD_CAN) + if (!link->network) + return false; + + if (link->network->bond) return false; /* DHCPv6 client will not be started if no IPv6 link-local address is configured. */