summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authororion <orion@FreeBSD.org>2002-03-20 15:56:36 +0000
committerorion <orion@FreeBSD.org>2002-03-20 15:56:36 +0000
commit10ea87ba4be269a72fa25a58c6ae05d19b4d4720 (patch)
tree29030bfb4073c49973d60b4387bc572b39ca7aec /sys/netinet/if_ether.c
parent054849916a182219f88c160d6069d5c9d5824294 (diff)
downloadFreeBSD-src-10ea87ba4be269a72fa25a58c6ae05d19b4d4720.zip
FreeBSD-src-10ea87ba4be269a72fa25a58c6ae05d19b4d4720.tar.gz
Send periodic ARP requests when ARP entries for hosts we are sending
to are about to expire. This prevents high packet rate flows from experiencing packet drops at the sender following ARP cache entry timeout. PR: kern/25517 Reviewed by: luigi MFC after: 7 days
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 68b2221..1bd85a3 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -427,6 +427,21 @@ arpresolve(ifp, rt, m, dst, desten, rt0)
*/
if ((rt->rt_expire == 0 || rt->rt_expire > time_second) &&
sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
+ /*
+ * If entry has an expiry time and it is approaching,
+ * see if we need to send an ARP request within this
+ * arpt_down interval.
+ */
+ if ((rt->rt_expire != 0) &&
+ (time_second + (arp_maxtries - la->la_asked) * 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++;
+ }
+
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
return 1;
}
OpenPOWER on IntegriCloud