net: if: Add IPv4 support to multicast monitor

Make multicast group join/leave monitor support both IPv6 and IPv4
addresses.

Fixes #26585

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
This commit is contained in:
Markus Fuchs 2021-09-13 16:44:44 +02:00 committed by Christopher Friedt
commit 7926657b27
5 changed files with 72 additions and 48 deletions

View file

@ -285,6 +285,8 @@ int net_ipv4_igmp_join(struct net_if *iface, const struct in_addr *addr)
net_if_ipv4_maddr_join(maddr);
net_if_mcast_monitor(iface, &maddr->address, true);
net_mgmt_event_notify_with_info(NET_EVENT_IPV4_MCAST_JOIN, iface,
&maddr->address.in_addr,
sizeof(struct in_addr));
@ -312,6 +314,8 @@ int net_ipv4_igmp_leave(struct net_if *iface, const struct in_addr *addr)
net_if_ipv4_maddr_leave(maddr);
net_if_mcast_monitor(iface, &maddr->address, false);
net_mgmt_event_notify_with_info(NET_EVENT_IPV4_MCAST_LEAVE, iface,
&maddr->address.in_addr,
sizeof(struct in_addr));