aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorOrion Hodson <orion@FreeBSD.org>2003-02-08 15:05:15 +0000
committerOrion Hodson <orion@FreeBSD.org>2003-02-08 15:05:15 +0000
commit022695f82a0a18015762cfc5da78461c1686e7fa (patch)
tree707c92d56c8fc21c1164f4f98cbf604c0bb8af66 /sys/netinet/if_ether.c
parenta09a56b5ad90f49298271df0b00b061b93abb3a2 (diff)
Notes
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index b8d94532a4ea9..4a4d91ff5b546 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -97,7 +97,7 @@ struct llinfo_arp {
LIST_ENTRY(llinfo_arp) la_le;
struct rtentry *la_rt;
struct mbuf *la_hold; /* last packet until resolved/timeout */
- u_short la_preempt; /* #times we QUERIED before entry expiration */
+ u_short la_preempt; /* countdown for pre-expiry arps */
u_short la_asked; /* #times we QUERIED following expiration */
#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
};
@@ -442,13 +442,12 @@ arpresolve(ifp, rt, m, dst, desten, rt0)
* arpt_down interval.
*/
if ((rt->rt_expire != 0) &&
- (time_second + (arp_maxtries - la->la_preempt) * arpt_down
- > rt->rt_expire)) {
+ (time_second + la->la_preempt > rt->rt_expire)) {
arprequest(ifp,
&SIN(rt->rt_ifa->ifa_addr)->sin_addr,
&SIN(dst)->sin_addr,
IF_LLADDR(ifp));
- la->la_preempt++;
+ la->la_preempt--;
}
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
@@ -484,7 +483,8 @@ arpresolve(ifp, rt, m, dst, desten, rt0)
} else {
rt->rt_flags |= RTF_REJECT;
rt->rt_expire += arpt_down;
- la->la_preempt = la->la_asked = 0;
+ la->la_asked = 0;
+ la->la_preempt = arp_maxtries;
}
}
@@ -745,7 +745,8 @@ match:
if (rt->rt_expire)
rt->rt_expire = time_second + arpt_keep;
rt->rt_flags &= ~RTF_REJECT;
- la->la_preempt = la->la_asked = 0;
+ la->la_asked = 0;
+ la->la_preempt = arp_maxtries;
if (la->la_hold) {
(*ifp->if_output)(ifp, la->la_hold,
rt_key(rt), rt);