Skip to content

Commit ba5bcb1

Browse files
IVandeVeirecarlescufi
authored andcommitted
net: ip: igmp: removed compiler warning when igmpv3 is enabled
Made the definition of in_addr all_routers conditional to remove compiler warning: warning: 'all_routers' defined but not used [-Wunused-const-variable=] The warning occurs when igmpv3 is enabled. Signed-off-by: Ibe Van de Veire <[email protected]>
1 parent c55593c commit ba5bcb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/ip/igmp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ LOG_MODULE_DECLARE(net_ipv4, CONFIG_NET_IPV4_LOG_LEVEL);
3636
#define IGMPV3_BLOCK_OLD_SOURCES 0x06
3737

3838
static const struct in_addr all_systems = { { { 224, 0, 0, 1 } } };
39-
static const struct in_addr all_routers = { { { 224, 0, 0, 2 } } };
4039
#if defined(CONFIG_NET_IPV4_IGMPV3)
4140
static const struct in_addr igmp_multicast_addr = { { { 224, 0, 0, 22 } } };
41+
#else
42+
static const struct in_addr all_routers = { { { 224, 0, 0, 2 } } };
4243
#endif
4344

4445
#define dbg_addr(action, pkt_str, src, dst) \

0 commit comments

Comments
 (0)