diff options
author | peter <peter@FreeBSD.org> | 2002-06-20 01:27:40 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-06-20 01:27:40 +0000 |
commit | c7fdf6d30bf1c224009e7a8d15c3e6ba7eca8472 (patch) | |
tree | db7ad1544554aeb09acfe41bb750b55ccbd2b7a0 /sys | |
parent | 4a3cef9fbf32011fd241cdb4112f8bc5b3b2afdb (diff) | |
download | FreeBSD-src-c7fdf6d30bf1c224009e7a8d15c3e6ba7eca8472.zip FreeBSD-src-c7fdf6d30bf1c224009e7a8d15c3e6ba7eca8472.tar.gz |
Solve the 'unregistered netisr 18' information notice with a sledgehammer.
Register the ISR early, but do not actually kick off the timer until we
see some activity. This still saves us from running the arp timers on
a system with no network cards.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/if_ether.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index e562df7..77eee3c 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -102,7 +102,7 @@ struct llinfo_arp { static LIST_HEAD(, llinfo_arp) llinfo_arp; struct ifqueue arpintrq; -static int arp_inuse, arp_allocated; +static int arp_inuse, arp_allocated, arpinit_done; static int arp_maxtries = 5; static int useloopback = 1; /* use loopback interface for local traffic */ @@ -162,13 +162,10 @@ arp_rtrequest(req, rt, info) register struct sockaddr *gate = rt->rt_gateway; register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; - static int arpinit_done; if (!arpinit_done) { arpinit_done = 1; - LIST_INIT(&llinfo_arp); timeout(arptimer, (caddr_t)0, hz); - register_netisr(NETISR_ARP, arpintr); } if (rt->rt_flags & RTF_GATEWAY) return; @@ -494,6 +491,10 @@ arpintr() register struct arphdr *ar; int s; + if (!arpinit_done) { + arpinit_done = 1; + timeout(arptimer, (caddr_t)0, hz); + } while (arpintrq.ifq_head) { s = splimp(); IF_DEQUEUE(&arpintrq, m); @@ -943,6 +944,8 @@ arp_init(void) arpintrq.ifq_maxlen = 50; mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); + LIST_INIT(&llinfo_arp); + register_netisr(NETISR_ARP, arpintr); } SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); |