mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
Catch up with kernel using time_uptime to drive ARP timeouts.
Noticed by: jilles
This commit is contained in:
parent
cdfc719c2e
commit
441238cfdc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216225
@ -666,6 +666,7 @@ struct {
|
|||||||
static void
|
static void
|
||||||
update_arptab(u_char *ep, in_addr_t ipaddr)
|
update_arptab(u_char *ep, in_addr_t ipaddr)
|
||||||
{
|
{
|
||||||
|
struct timespec tp;
|
||||||
int cc;
|
int cc;
|
||||||
struct sockaddr_inarp *ar, *ar2;
|
struct sockaddr_inarp *ar, *ar2;
|
||||||
struct sockaddr_dl *ll, *ll2;
|
struct sockaddr_dl *ll, *ll2;
|
||||||
@ -731,7 +732,8 @@ update_arptab(u_char *ep, in_addr_t ipaddr)
|
|||||||
rt->rtm_version = RTM_VERSION;
|
rt->rtm_version = RTM_VERSION;
|
||||||
rt->rtm_addrs = RTA_DST | RTA_GATEWAY;
|
rt->rtm_addrs = RTA_DST | RTA_GATEWAY;
|
||||||
rt->rtm_inits = RTV_EXPIRE;
|
rt->rtm_inits = RTV_EXPIRE;
|
||||||
rt->rtm_rmx.rmx_expire = time(0) + ARPSECS;
|
clock_gettime(CLOCK_MONOTONIC, &tp);
|
||||||
|
rt->rtm_rmx.rmx_expire = tp.tv_sec + ARPSECS;
|
||||||
rt->rtm_flags = RTF_HOST | RTF_STATIC;
|
rt->rtm_flags = RTF_HOST | RTF_STATIC;
|
||||||
rt->rtm_type = RTM_ADD;
|
rt->rtm_type = RTM_ADD;
|
||||||
rt->rtm_seq = ++seq;
|
rt->rtm_seq = ++seq;
|
||||||
|
Loading…
Reference in New Issue
Block a user