Catch up with kernel using time_uptime to drive ARP timeouts.

Noticed by:	jilles
This commit is contained in:
glebius 2010-12-06 09:39:36 +00:00
parent 4d4fc1fa3d
commit f2bb89e063

View File

@ -126,7 +126,7 @@ int bsd_arp_set(ia, eaddr, len)
register struct sockaddr_dl *sdl; register struct sockaddr_dl *sdl;
register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
u_char *ea; u_char *ea;
struct timeval time; struct timespec tp;
int op = RTM_ADD; int op = RTM_ADD;
getsocket(); getsocket();
@ -140,8 +140,8 @@ int bsd_arp_set(ia, eaddr, len)
doing_proxy = flags = export_only = expire_time = 0; doing_proxy = flags = export_only = expire_time = 0;
/* make arp entry temporary */ /* make arp entry temporary */
gettimeofday(&time, 0); clock_gettime(CLOCK_MONOTONIC, &tp);
expire_time = time.tv_sec + 20 * 60; expire_time = tp.tv_sec + 20 * 60;
tryagain: tryagain:
if (rtmsg(RTM_GET) < 0) { if (rtmsg(RTM_GET) < 0) {