aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorGary Palmer <gpalmer@FreeBSD.org>1996-06-10 23:07:36 +0000
committerGary Palmer <gpalmer@FreeBSD.org>1996-06-10 23:07:36 +0000
commite39a0280cb07f5cb2a01c8dda54c7bd3f0a2003a (patch)
tree873cfb6a0afbdf68e48eb5fc1d9b647963c2ab23 /sys/net/if.c
parent8565e2e0329b4e3fb5788ba856c25b27c1cd830d (diff)
downloadsrc-e39a0280cb07f5cb2a01c8dda54c7bd3f0a2003a.tar.gz
src-e39a0280cb07f5cb2a01c8dda54c7bd3f0a2003a.zip
Change the use if ifnet.if_lastchange to be more in line with
SNMP requirements. Update description of ifnet.if_lastchange in if.h to indicate this.
Notes
Notes: svn path=/head/; revision=16287
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 5d67e49a849e..e73fdb6b6bf1 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.29 1996/03/11 15:13:00 davidg Exp $
+ * $Id: if.c,v 1.30 1996/06/05 17:12:41 wollman Exp $
*/
#include <sys/param.h>
@@ -115,6 +115,7 @@ if_attach(ifp)
p = &((*p)->if_next);
*p = ifp;
ifp->if_index = ++if_index;
+ ifp->if_lastchange = time;
if (ifnet_addrs == 0 || if_index >= if_indexlim) {
unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
struct ifaddr **q = (struct ifaddr **)
@@ -356,6 +357,7 @@ if_down(ifp)
register struct ifaddr *ifa;
ifp->if_flags &= ~IFF_UP;
+ ifp->if_lastchange = time;
for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
if_qflush(&ifp->if_snd);
@@ -373,6 +375,7 @@ if_up(ifp)
{
ifp->if_flags |= IFF_UP;
+ ifp->if_lastchange = time;
#ifdef notyet
register struct ifaddr *ifa;
/* this has no effect on IP, and will kill all iso connections XXX */
@@ -525,6 +528,7 @@ ifioctl(so, cmd, data, p)
(ifr->ifr_flags &~ IFF_CANTCHANGE);
if (ifp->if_ioctl)
(void) (*ifp->if_ioctl)(ifp, cmd, data);
+ ifp->if_lastchange = time;
break;
case SIOCSIFMETRIC:
@@ -532,14 +536,19 @@ ifioctl(so, cmd, data, p)
if (error)
return (error);
ifp->if_metric = ifr->ifr_metric;
+ ifp->if_lastchange = time;
break;
case SIOCSIFPHYS:
error = suser(p->p_ucred, &p->p_acflag);
- if (error) return error;
-
- if (!ifp->if_ioctl) return EOPNOTSUPP;
- return ifp->if_ioctl(ifp, cmd, data);
+ if (error)
+ return error;
+ if (!ifp->if_ioctl)
+ return EOPNOTSUPP;
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
+ if (error == 0)
+ ifp->if_lastchange = time;
+ return(error);
case SIOCSIFMTU:
error = suser(p->p_ucred, &p->p_acflag);
@@ -553,7 +562,10 @@ ifioctl(so, cmd, data, p)
*/
if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
return (EINVAL);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
+ if (error == 0)
+ ifp->if_lastchange = time;
+ return(error);
case SIOCADDMULTI:
case SIOCDELMULTI:
@@ -562,7 +574,10 @@ ifioctl(so, cmd, data, p)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
- return ((*ifp->if_ioctl)(ifp, cmd, data));
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
+ if (error == 0 )
+ ifp->if_lastchange = time;
+ return(error);
default:
if (so->so_proto == 0)