Do not perform arp send/resolve on an interface marked NOARP.

PR: 25006
MFC after: 2 weeks
This commit is contained in:
Jonathan Lemon 2001-06-15 21:00:32 +00:00
parent 5d8eff0053
commit 08aadfbb98
4 changed files with 18 additions and 6 deletions

View File

@ -542,6 +542,11 @@ ether_demux(ifp, eh, m)
break;
case ETHERTYPE_ARP:
if (ifp->if_flags & IFF_NOARP) {
/* Discard packet if ARP is disabled on interface */
m_freem(m);
return;
}
schednetisr(NETISR_ARP);
inq = &arpintrq;
break;

View File

@ -443,14 +443,11 @@ fddi_input(ifp, fh, m)
break;
case ETHERTYPE_ARP:
#if !defined(__bsdi__) || _BSDI_VERSION >= 199401
if (ifp->if_flags & IFF_NOARP)
goto dropanyway;
schednetisr(NETISR_ARP);
inq = &arpintrq;
break;
#else
arpinput((struct arpcom *)ifp, m);
return;
#endif
#endif
#ifdef INET6
case ETHERTYPE_IPV6:

View File

@ -473,6 +473,8 @@ iso88025_input(ifp, th, m)
break;
case ETHERTYPE_ARP:
if (ifp->if_flags & IFF_NOARP)
goto dropanyway;
schednetisr(NETISR_ARP);
inq = &arpintrq;
break;

View File

@ -368,7 +368,7 @@ arpresolve(ac, rt, m, dst, desten, rt0)
register u_char *desten;
struct rtentry *rt0;
{
register struct llinfo_arp *la = 0;
struct llinfo_arp *la = 0;
struct sockaddr_dl *sdl;
if (m->m_flags & M_BCAST) { /* broadcast */
@ -403,6 +403,14 @@ arpresolve(ac, rt, m, dst, desten, rt0)
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
return 1;
}
/*
* If ARP is disabled on this interface, stop.
* XXX
* Probably should not allocate empty llinfo struct if we are
* not going to be sending out an arp request.
*/
if (ac->ac_if.if_flags & IFF_NOARP)
return (0);
/*
* There is an arptab entry, but no ethernet address
* response yet. Replace the held mbuf with this