From 1c51f7cbbfe0e5ea9e5922de3090d237f753253d Mon Sep 17 00:00:00 2001 From: Chamira Perera Date: Thu, 19 Jan 2023 12:34:14 +1100 Subject: [PATCH] net: ipv4: Using a different API to ensure that IPv4 is enabled When init_igmp is called the ipv4 pointer was not initialised. Therefore, a different API needs to be used to ensure that IPv4 is enabled when calling init_igmp. Fixes #53913 Signed-off-by: Chamira Perera --- subsys/net/ip/net_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index d181ba12e99..1392140b287 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -4162,8 +4162,8 @@ exit: static void init_igmp(struct net_if *iface) { #if defined(CONFIG_NET_IPV4_IGMP) - /* Ensure IPv4 is enabled for this interface */ - if (iface->config.ip.ipv4 == NULL) { + /* Ensure IPv4 is enabled for this interface. */ + if (net_if_config_ipv4_get(iface, NULL)) { return; }