Do not hardcode (20*60), but use current ARP timeout value configured

in kernel.
This commit is contained in:
Gleb Smirnoff 2010-11-30 16:14:19 +00:00
parent 9decd44681
commit 84d8f5b8d0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216078

View File

@ -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;