Module Name: src
Committed By: msaitoh
Date: Thu Nov 1 06:36:30 UTC 2012
Modified Files:
src/sys/net: if.c
Log Message:
Fix a bug that SIOCZIFDATA clears if_lastchage by zero.
Update if_lastchange with getnanotime().
To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 src/sys/net/if.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.260 src/sys/net/if.c:1.261
--- src/sys/net/if.c:1.260 Fri Feb 3 03:35:30 2012
+++ src/sys/net/if.c Thu Nov 1 06:36:30 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.260 2012/02/03 03:35:30 christos Exp $ */
+/* $NetBSD: if.c,v 1.261 2012/11/01 06:36:30 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.260 2012/02/03 03:35:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.261 2012/11/01 06:36:30 msaitoh Exp $");
#include "opt_inet.h"
@@ -1614,6 +1614,14 @@ ifioctl_common(struct ifnet *ifp, u_long
*/
memset(&ifp->if_data.ifi_ipackets, 0, sizeof(ifp->if_data) -
offsetof(struct if_data, ifi_ipackets));
+ /*
+ * The memset() clears to the bottm of if_data. In the area,
+ * if_lastchange is included. Please be careful if new entry
+ * will be added into if_data or rewite this.
+ *
+ * And also, update if_lastchnage.
+ */
+ getnanotime(&ifp->if_lastchange);
break;
case SIOCSIFMTU:
ifr = data;