this moves revarp processing to softnet because it is not mpsafe.
it works fine for general use, but i would like someone to test it
with diskless booting. ie, i want to know if nfs root works with this.
ok?
Index: net/if_ethersubr.c
===================================================================
RCS file: /cvs/src/sys/net/if_ethersubr.c,v
retrieving revision 1.224
diff -u -p -r1.224 if_ethersubr.c
--- net/if_ethersubr.c 12 Sep 2015 13:34:12 -0000 1.224
+++ net/if_ethersubr.c 13 Sep 2015 09:28:14 -0000
@@ -296,6 +296,7 @@ ether_input(struct ifnet *ifp, struct mb
struct ether_header *eh_tmp;
#endif
+ ac = (struct arpcom *)ifp;
eh = mtod(m, struct ether_header *);
m_adj(m, ETHER_HDR_LEN);
@@ -305,7 +306,7 @@ ether_input(struct ifnet *ifp, struct mb
* if it came from us.
*/
if ((ifp->if_flags & IFF_SIMPLEX) == 0) {
- if (memcmp(LLADDR(ifp->if_sadl), eh->ether_shost,
+ if (memcmp(ac->ac_enaddr, eh->ether_shost,
ETHER_ADDR_LEN) == 0) {
m_freem(m);
return (1);
@@ -320,10 +321,6 @@ ether_input(struct ifnet *ifp, struct mb
ifp->if_imcasts++;
}
- etype = ntohs(eh->ether_type);
-
- ac = (struct arpcom *)ifp;
-
/*
* If packet has been filtered by the bpf listener, drop it now
* also HW vlan tagged packets that were not collected by vlan(4)
@@ -346,6 +343,8 @@ ether_input(struct ifnet *ifp, struct mb
}
}
+ etype = ntohs(eh->ether_type);
+
decapsulate:
switch (etype) {
case ETHERTYPE_IP:
@@ -361,7 +360,7 @@ decapsulate:
case ETHERTYPE_REVARP:
if (ifp->if_flags & IFF_NOARP)
goto dropanyway;
- revarpinput(m); /* XXX queue? */
+ inq = &rarpintrq;
return (1);
#ifdef INET6
Index: netinet/if_ether.c
===================================================================
RCS file: /cvs/src/sys/netinet/if_ether.c,v
retrieving revision 1.166
diff -u -p -r1.166 if_ether.c
--- netinet/if_ether.c 12 Sep 2015 20:26:07 -0000 1.166
+++ netinet/if_ether.c 13 Sep 2015 09:28:14 -0000
@@ -95,11 +95,14 @@ void arptfree(struct llinfo_arp *);
void arptimer(void *);
struct rtentry *arplookup(u_int32_t, int, int, u_int);
void in_arpinput(struct mbuf *);
+void revarpinput(struct mbuf *);
+void in_revarpinput(struct mbuf *);
LIST_HEAD(, llinfo_arp) llinfo_arp;
struct pool arp_pool; /* pool for llinfo_arp structures */
/* XXX hate magic numbers */
struct niqueue arpintrq = NIQUEUE_INITIALIZER(50, NETISR_ARP);
+struct niqueue rarpintrq = NIQUEUE_INITIALIZER(50, NETISR_ARP);
int arp_inuse, arp_allocated;
int arp_maxtries = 5;
int arpinit_done;
@@ -498,6 +501,9 @@ arpintr(void)
}
m_freem(m);
}
+
+ while ((m = niq_dequeue(&rarpintrq)) != NULL)
+ revarpinput(m);
}
/*
Index: netinet/if_ether.h
===================================================================
RCS file: /cvs/src/sys/netinet/if_ether.h,v
retrieving revision 1.58
diff -u -p -r1.58 if_ether.h
--- netinet/if_ether.h 10 Sep 2015 07:43:18 -0000 1.58
+++ netinet/if_ether.h 13 Sep 2015 09:28:14 -0000
@@ -189,6 +189,7 @@ extern u_int8_t etherbroadcastaddr[ETHER
extern u_int8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
extern u_int8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
extern struct niqueue arpintrq;
+extern struct niqueue rarpintrq;
void arpwhohas(struct arpcom *, struct in_addr *);
void arpintr(void);
@@ -273,8 +274,6 @@ extern struct ifnet *revarp_ifp;
void arprequest(struct ifnet *, u_int32_t *, u_int32_t *, u_int8_t *);
int arpproxy(struct in_addr, unsigned int);
-void revarpinput(struct mbuf *);
-void in_revarpinput(struct mbuf *);
void revarprequest(struct ifnet *);
int revarpwhoarewe(struct ifnet *, struct in_addr *, struct in_addr *);
int revarpwhoami(struct in_addr *, struct ifnet *);