diff options
author | orion <orion@FreeBSD.org> | 2003-02-04 05:28:08 +0000 |
---|---|---|
committer | orion <orion@FreeBSD.org> | 2003-02-04 05:28:08 +0000 |
commit | 946aecb3fe9d2bb40e9d0e51f0ba61db63a9bd3d (patch) | |
tree | f25d32a3cf28990849ae476b501ebfaadf3f5c99 /sys/netinet | |
parent | b1a2e9acb4bfd5ecd9e91ca327fc940f980b8a07 (diff) | |
download | FreeBSD-src-946aecb3fe9d2bb40e9d0e51f0ba61db63a9bd3d.zip FreeBSD-src-946aecb3fe9d2bb40e9d0e51f0ba61db63a9bd3d.tar.gz |
MFS 1.64.2.22: Re-enable non pre-emptive ARP requests.
Submitted by: "Diomidis Spinellis" <dds@aueb.gr>
PR: kern/46116
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b95cea3..b8d9453 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -96,8 +96,9 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUTO, host_down_time, CTLFLAG_RW, struct llinfo_arp { LIST_ENTRY(llinfo_arp) la_le; struct rtentry *la_rt; - struct mbuf *la_hold; /* last packet until resolved/timeout */ - long la_asked; /* last time we QUERIED for this addr */ + struct mbuf *la_hold; /* last packet until resolved/timeout */ + u_short la_preempt; /* #times we QUERIED before entry expiration */ + u_short la_asked; /* #times we QUERIED following expiration */ #define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */ }; @@ -441,13 +442,13 @@ arpresolve(ifp, rt, m, dst, desten, rt0) * arpt_down interval. */ if ((rt->rt_expire != 0) && - (time_second + (arp_maxtries - la->la_asked) * arpt_down > - rt->rt_expire)) { + (time_second + (arp_maxtries - la->la_preempt) * arpt_down + > rt->rt_expire)) { arprequest(ifp, &SIN(rt->rt_ifa->ifa_addr)->sin_addr, &SIN(dst)->sin_addr, IF_LLADDR(ifp)); - la->la_asked++; + la->la_preempt++; } bcopy(LLADDR(sdl), desten, sdl->sdl_alen); @@ -475,15 +476,15 @@ arpresolve(ifp, rt, m, dst, desten, rt0) rt->rt_flags &= ~RTF_REJECT; if (la->la_asked == 0 || rt->rt_expire != time_second) { rt->rt_expire = time_second; - if (la->la_asked++ < arp_maxtries) - arprequest(ifp, - &SIN(rt->rt_ifa->ifa_addr)->sin_addr, - &SIN(dst)->sin_addr, - IF_LLADDR(ifp)); - else { + if (la->la_asked++ < arp_maxtries) { + arprequest(ifp, + &SIN(rt->rt_ifa->ifa_addr)->sin_addr, + &SIN(dst)->sin_addr, + IF_LLADDR(ifp)); + } else { rt->rt_flags |= RTF_REJECT; rt->rt_expire += arpt_down; - la->la_asked = 0; + la->la_preempt = la->la_asked = 0; } } @@ -744,7 +745,7 @@ match: if (rt->rt_expire) rt->rt_expire = time_second + arpt_keep; rt->rt_flags &= ~RTF_REJECT; - la->la_asked = 0; + la->la_preempt = la->la_asked = 0; if (la->la_hold) { (*ifp->if_output)(ifp, la->la_hold, rt_key(rt), rt); @@ -894,7 +895,7 @@ arptfree(la) if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) && sdl->sdl_family == AF_LINK) { sdl->sdl_alen = 0; - la->la_asked = 0; + la->la_preempt = la->la_asked = 0; rt->rt_flags &= ~RTF_REJECT; return; } |