Module Name:    src
Committed By:   riz
Date:           Mon Nov 19 20:04:22 UTC 2012

Modified Files:
        src/sys/net [netbsd-6]: if.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #669):
        sys/net/if.c: revision 1.261
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.260.2.1 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.260.2.1
--- src/sys/net/if.c:1.260	Fri Feb  3 03:35:30 2012
+++ src/sys/net/if.c	Mon Nov 19 20:04:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.260 2012/02/03 03:35:30 christos Exp $	*/
+/*	$NetBSD: if.c,v 1.260.2.1 2012/11/19 20:04:22 riz 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.260.2.1 2012/11/19 20:04:22 riz 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;

Reply via email to