]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix possible NULL-pointer dereference
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Aug 2022 18:32:55 +0000 (03:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Aug 2022 18:32:55 +0000 (03:32 +0900)
src/network/networkd-link.c

index 269f69ec21cb531c4f9ff29d5ee3cde0fe43da04..c8df554cd62f8e9c47772a471cc88942c3817db2 100644 (file)
@@ -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. */