From 08aadfbb983a94932af342a1927b6c9356bc7ea6 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Fri, 15 Jun 2001 21:00:32 +0000 Subject: Do not perform arp send/resolve on an interface marked NOARP. PR: 25006 MFC after: 2 weeks --- sys/net/if_ethersubr.c | 5 +++++ sys/net/if_fddisubr.c | 7 ++----- sys/net/if_iso88025subr.c | 2 ++ sys/netinet/if_ether.c | 10 +++++++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index f475f9152068..5b646b8565df 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -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; diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 734eeec7c141..0fc84517b6e5 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -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: diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index a5538e0dbad2..2fd7747d468d 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -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; diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index de5d906e33d7..8c8f01f0287b 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -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 -- cgit v1.3