Avoid NULL dereference in arpresolve.

This commit is contained in:
Navdeep Parhar 2010-01-03 06:43:13 +00:00
parent dd2bf8ea67
commit 567145993f

View File

@ -372,8 +372,8 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
if (la->la_asked < V_arp_maxtries)
error = EWOULDBLOCK; /* First request. */
else
error =
(rt0->rt_flags & RTF_GATEWAY) ? EHOSTUNREACH : EHOSTDOWN;
error = rt0 != NULL && (rt0->rt_flags & RTF_GATEWAY) ?
EHOSTUNREACH : EHOSTDOWN;
if (renew) {
LLE_ADDREF(la);