Add additional robustness to at_aarpinput() by testing for broadcast

addresses as the source of an AARP request.  While this PR was submitted
in the context of work in OpenBSD to port netatalk (in 1997), I've
synchronized the code more to our ARP input routine, which had similar
requirements.

Submitted by:	Denton Gentry
PR:		kern/4184
MFC after:	1 week
This commit is contained in:
rwatson 2007-11-20 18:35:57 +00:00
parent e13e970d04
commit 261a3b571d

View File

@ -354,6 +354,13 @@ at_aarpinput(struct ifnet *ifp, struct mbuf *m)
return;
}
/* Don't accept requests from broadcast address. */
if (!bcmp(ea->aarp_sha, ifp->if_broadcastaddr, ifp->if_addrlen)) {
log(LOG_ERR, "aarp: source link address is broadcast\n");
m_freem(m);
return;
}
op = ntohs(ea->aarp_op);
bcopy(ea->aarp_tpnet, &net, sizeof(net));