Don't panic in arpresolve if we're given a null mbuf. We could
insist that the caller just pass in an initialized mbuf even if didn't have any data - but that seems rather contrived.
This commit is contained in:
parent
6821aba9e5
commit
58505389d1
@ -362,13 +362,16 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
|||||||
struct sockaddr_dl *sdl;
|
struct sockaddr_dl *sdl;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (m->m_flags & M_BCAST) { /* broadcast */
|
if (m != NULL) {
|
||||||
(void)memcpy(desten, ifp->if_broadcastaddr, ifp->if_addrlen);
|
|
||||||
return (0);
|
if (m->m_flags & M_BCAST) { /* broadcast */
|
||||||
}
|
(void)memcpy(desten, ifp->if_broadcastaddr, ifp->if_addrlen);
|
||||||
if (m->m_flags & M_MCAST && ifp->if_type != IFT_ARCNET) {/* multicast */
|
return (0);
|
||||||
ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
|
}
|
||||||
return (0);
|
if (m->m_flags & M_MCAST && ifp->if_type != IFT_ARCNET) {/* multicast */
|
||||||
|
ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rt0 != NULL) {
|
if (rt0 != NULL) {
|
||||||
@ -449,10 +452,11 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
|||||||
* response yet. Replace the held mbuf with this
|
* response yet. Replace the held mbuf with this
|
||||||
* latest one.
|
* latest one.
|
||||||
*/
|
*/
|
||||||
if (la->la_hold)
|
if (m != NULL) {
|
||||||
m_freem(la->la_hold);
|
if (la->la_hold)
|
||||||
la->la_hold = m;
|
m_freem(la->la_hold);
|
||||||
|
la->la_hold = m;
|
||||||
|
}
|
||||||
KASSERT(rt->rt_expire > 0, ("sending ARP request for static entry"));
|
KASSERT(rt->rt_expire > 0, ("sending ARP request for static entry"));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user