svn commit: r292379 - in head/sys: netinet netinet6

Steven Hartland smh at FreeBSD.org
Wed Dec 16 22:26:29 UTC 2015


Author: smh
Date: Wed Dec 16 22:26:28 2015
New Revision: 292379
URL: https://svnweb.freebsd.org/changeset/base/292379

Log:
  Fix issues introduced by r292275
  
  * Fix panic for etherswitches which don't have a LLADDR.
  * Disabled DELAY in unsolicited NDA, which needs further work.
  * Fixed missing DELAY in carp_send_na.
  * style(9) fix.
  
  Reported by:	kp & melifaro
  X-MFC-With:	r292275
  MFC after:	1 month
  Sponsored by:	Multiplay

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/ip_carp.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_nbr.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Wed Dec 16 22:01:26 2015	(r292378)
+++ head/sys/netinet/if_ether.c	Wed Dec 16 22:26:28 2015	(r292379)
@@ -1217,7 +1217,8 @@ arp_announce(struct ifnet *ifp)
 	struct ifaddr *ifa;
 	struct in_addr *addr, *head;
 
-	if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP))
+	if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP) ||
+	    ifp->if_addr == NULL)
 		return;
 
 	entries = 8;
@@ -1254,9 +1255,11 @@ arp_announce(struct ifnet *ifp)
 	}
 	IF_ADDR_RUNLOCK(ifp);
 
-	lladdr = IF_LLADDR(ifp);
-	for (i = 0; i < cnt; i++) {
-		arp_announce_addr(ifp, head + i, lladdr);
+	if (cnt > 0) {
+		lladdr = IF_LLADDR(ifp);
+		for (i = 0; i < cnt; i++) {
+			arp_announce_addr(ifp, head + i, lladdr);
+		}
 	}
 	free(head, M_TEMP);
 }

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Wed Dec 16 22:01:26 2015	(r292378)
+++ head/sys/netinet/ip_carp.c	Wed Dec 16 22:26:28 2015	(r292379)
@@ -1045,7 +1045,7 @@ carp_send_na(struct carp_softc *sc)
 
 		nd6_na_output_unsolicited_addr(sc->sc_carpdev, IFA_IN6(ifa),
 		    IFA_ND6_NA_BASE_FLAGS(sc->sc_carpdev, ifa));
-		nd6_na_unsolicited_addr_delay(ifa);
+		DELAY(nd6_na_unsolicited_addr_delay(ifa));
 	}
 }
 

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Wed Dec 16 22:01:26 2015	(r292378)
+++ head/sys/netinet6/nd6.c	Wed Dec 16 22:26:28 2015	(r292379)
@@ -209,6 +209,7 @@ nd6_ifnet_link_event(void *arg __unused,
 	if (linkstate == LINK_STATE_UP && V_nd6_on_link)
 		nd6_na_output_unsolicited(ifp);
 }
+
 void
 nd6_init(void)
 {

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c	Wed Dec 16 22:01:26 2015	(r292378)
+++ head/sys/netinet6/nd6_nbr.c	Wed Dec 16 22:26:28 2015	(r292379)
@@ -1646,7 +1646,8 @@ nd6_na_output_unsolicited(struct ifnet *
 		i++;
 		if (i == cnt)
 			break;
-		DELAY(ann1->delay);
+		/* XXX DELAY needs to be done in taskqueue to avoid stalling. */
+		//DELAY(ann1->delay);
 	}
 	free(head, M_TEMP);
 }


More information about the svn-src-head mailing list