From cfff63f1b8051b51e1a29d3f9133a3d91b940582 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Sun, 25 Apr 2004 12:50:14 +0000 Subject: Start the arp timer at init time. It runs so rarely that it makes no sense to wait until the first request. --- sys/netinet/if_ether.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 1bdc1fb9eb9f..900051db10c2 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -102,7 +102,6 @@ static LIST_HEAD(, llinfo_arp) llinfo_arp; static struct ifqueue arpintrq; static int arp_allocated; -static int arpinit_done; static int arp_maxtries = 5; static int useloopback = 1; /* use loopback interface for local traffic */ @@ -168,10 +167,6 @@ arp_rtrequest(req, rt, info) RT_LOCK_ASSERT(rt); - if (!arpinit_done) { - arpinit_done = 1; - callout_reset(&arp_callout, hz, arptimer, NULL); - } if (rt->rt_flags & RTF_GATEWAY) return; gate = rt->rt_gateway; @@ -466,11 +461,6 @@ arpintr(struct mbuf *m) { struct arphdr *ar; - if (!arpinit_done) { - /* NB: this race should not matter */ - arpinit_done = 1; - callout_reset(&arp_callout, hz, arptimer, NULL); - } if (m->m_len < sizeof(struct arphdr) && ((m = m_pullup(m, sizeof(struct arphdr))) == NULL)) { log(LOG_ERR, "arp: runt packet -- m_pullup failed\n"); @@ -902,5 +892,6 @@ arp_init(void) LIST_INIT(&llinfo_arp); callout_init(&arp_callout, CALLOUT_MPSAFE); netisr_register(NETISR_ARP, arpintr, &arpintrq, NETISR_MPSAFE); + callout_reset(&arp_callout, hz, arptimer, NULL); } SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); -- cgit v1.2.3