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
This commit is contained in:
Steven Hartland 2015-12-16 22:26:28 +00:00
parent b0cd20172d
commit 3a909afe8e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292379
4 changed files with 11 additions and 6 deletions

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -209,6 +209,7 @@ nd6_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate)
if (linkstate == LINK_STATE_UP && V_nd6_on_link)
nd6_na_output_unsolicited(ifp);
}
void
nd6_init(void)
{

View File

@ -1646,7 +1646,8 @@ nd6_na_output_unsolicited(struct ifnet *ifp)
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);
}