diff options
author | brooks <brooks@FreeBSD.org> | 2005-02-25 19:46:41 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-02-25 19:46:41 +0000 |
commit | e5a9c072c1563b17574a8123220f8773afeedcee (patch) | |
tree | 5895b9b8e3331ee9dc052b57c4b96c4d23adc658 /sys/net | |
parent | b3f1395f0dd0fa285d4af6993d6562c37844fb6f (diff) | |
download | FreeBSD-src-e5a9c072c1563b17574a8123220f8773afeedcee.zip FreeBSD-src-e5a9c072c1563b17574a8123220f8773afeedcee.tar.gz |
Change the definition of struct if_data's member ifi_epoch from wall
clock time to uptime because wall clock time may go backwards.
This is a change in the API which will impact SNMP agents who are using
ifi_epoch to set RFC2233's ifCounterDiscontinuityTime. None are know to
exist today. This will not impact applications that are using the
<index, epoch> tuple to verify interface uniqueness except that it
eliminates a race which could lead to a false assumption of uniqueness.
Because this is a behavior change, bump __FreeBSD_version.
Discussed with: re (jhb, scottl)
MFC after: 3 days
Pointed out by: pkh (way back at EuroBSDCon)
Pointy hat: brooks
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 2 | ||||
-rw-r--r-- | sys/net/if.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 82d078e..d257919 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -392,7 +392,7 @@ if_attach(struct ifnet *ifp) TAILQ_INIT(&ifp->if_multiaddrs); knlist_init(&ifp->if_klist, NULL); getmicrotime(&ifp->if_lastchange); - ifp->if_data.ifi_epoch = time_second; + ifp->if_data.ifi_epoch = time_uptime; #ifdef MAC mac_init_ifnet(ifp); diff --git a/sys/net/if.h b/sys/net/if.h index 0fa63d7..b4d5bdb 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -102,7 +102,7 @@ struct if_data { u_long ifi_iqdrops; /* dropped on input, this interface */ u_long ifi_noproto; /* destined for unsupported protocol */ u_long ifi_hwassist; /* HW offload capabilities */ - time_t ifi_epoch; /* time of attach or stat reset */ + time_t ifi_epoch; /* uptime at attach or stat reset */ #ifdef __alpha__ u_int ifi_timepad; /* time_t is int, not long on alpha */ #endif |