Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Nov 2010 16:14:19 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216078 - head/usr.sbin/arp
Message-ID:  <201011301614.oAUGEJ69010030@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Nov 30 16:14:19 2010
New Revision: 216078
URL: http://svn.freebsd.org/changeset/base/216078

Log:
  Do not hardcode (20*60), but use current ARP timeout value configured
  in kernel.

Modified:
  head/usr.sbin/arp/arp.c

Modified: head/usr.sbin/arp/arp.c
==============================================================================
--- head/usr.sbin/arp/arp.c	Tue Nov 30 16:04:40 2010	(r216077)
+++ head/usr.sbin/arp/arp.c	Tue Nov 30 16:14:19 2010	(r216078)
@@ -320,8 +320,14 @@ set(int argc, char **argv)
 	while (argc-- > 0) {
 		if (strncmp(argv[0], "temp", 4) == 0) {
 			struct timespec tp;
+			int max_age;
+			size_t len = sizeof(max_age);
+
 			clock_gettime(CLOCK_MONOTONIC, &tp);
-			expire_time = tp.tv_sec + 20 * 60;
+			if (sysctlbyname("net.link.ether.inet.max_age",
+			    &max_age, &len, NULL, 0) != 0)
+				err(1, "sysctlbyname");
+			expire_time = tp.tv_sec + max_age;
 		} else if (strncmp(argv[0], "pub", 3) == 0) {
 			flags |= RTF_ANNOUNCE;
 			doing_proxy = 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011301614.oAUGEJ69010030>