svn commit: r366893 - stable/12/sys/netinet

Andrey V. Elsukov ae at FreeBSD.org
Tue Oct 20 11:44:54 UTC 2020


Author: ae
Date: Tue Oct 20 11:44:54 2020
New Revision: 366893
URL: https://svnweb.freebsd.org/changeset/base/366893

Log:
  MFC r366682:
    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

Modified:
  stable/12/sys/netinet/in.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/in.c
==============================================================================
--- stable/12/sys/netinet/in.c	Tue Oct 20 11:40:37 2020	(r366892)
+++ stable/12/sys/netinet/in.c	Tue Oct 20 11:44:54 2020	(r366893)
@@ -379,10 +379,11 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne
 			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);
 


More information about the svn-src-all mailing list