From 8bdf813d3b98e5182811b31749df866bd2828dc4 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Tue, 20 Oct 2020 11:49:19 +0000 Subject: MFC 366682: Join to AllHosts multicast group again when adding an existing IPv4 address. When SIOCAIFADDR ioctl configures an IPv4 address that is already exist, it removes old ifaddr. When this IPv4 address is only one configured on the interface, this also leads to leaving from AllHosts multicast group. Then an address is added again, but due to the bug, this doesn't lead to joining to AllHosts multicast group. Submitted by: yannis.planus_alstomgroup.com --- sys/netinet/in.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 0e2b251effe2..901d7ff38d87 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -382,10 +382,11 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) continue; it = (struct in_ifaddr *)ifa; - iaIsFirst = false; if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) ia = it; + else + iaIsFirst = false; } IF_ADDR_RUNLOCK(ifp); -- cgit v1.2.3