summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2004-09-08 04:50:55 +0000
committerbrooks <brooks@FreeBSD.org>2004-09-08 04:50:55 +0000
commit143d77da28b1eae3998141ecdbf493f35562a44e (patch)
treea7d4a1fc271674863cbdba33a966ff9ffbd7cf3d /sys/net/if.c
parentdaf9c8d7593cfe8d6117f47b81c179d3198595ff (diff)
downloadFreeBSD-src-143d77da28b1eae3998141ecdbf493f35562a44e.zip
FreeBSD-src-143d77da28b1eae3998141ecdbf493f35562a44e.tar.gz
Re-add ifi_epoch, to struct if_data, this time replacing ifi_unused
to avoid ABI changes. It is set to the last time the interface counters were zeroed, currently the time if_attach() was called. It is intentended to be a valid value for RFC2233's ifCounterDiscontinuityTime and to make it easier for applications to verify that the interface they find at a given index is the one that was there last time they looked. Due to space constraints ifi_epoch is a time_t rather then a struct timeval. SNMP would prefer higher precision, but this unlikely to be useful in practice.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 1ba833e..7a84bf8 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -384,6 +384,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;
#ifdef MAC
mac_init_ifnet(ifp);
OpenPOWER on IntegriCloud