From 5fb5fae933132431d7ca5dd2865f42e1907e6fae Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 2 Aug 2022 03:32:55 +0900 Subject: [PATCH] network: fix possible NULL-pointer dereference --- src/network/networkd-link.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. */ -- 2.47.3