Module Name:    src
Committed By:   snj
Date:           Thu Apr 16 06:08:34 UTC 2015

Modified Files:
        src/sys/net [netbsd-7]: if.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #693):
        sys/net/if.h: revision 1.186
Use 1000ULL to prevent integer overflow (for IF_Gbps(10)). Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.174.2.1 src/sys/net/if.h

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.h
diff -u src/sys/net/if.h:1.174 src/sys/net/if.h:1.174.2.1
--- src/sys/net/if.h:1.174	Thu Jul 31 06:35:47 2014
+++ src/sys/net/if.h	Thu Apr 16 06:08:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.174 2014/07/31 06:35:47 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.174.2.1 2015/04/16 06:08:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -392,11 +392,10 @@ typedef struct ifnet {
 
 /*
  * Some convenience macros used for setting ifi_baudrate.
- * XXX 1000 vs. 1024? --thor...@netbsd.org
  */
-#define	IF_Kbps(x)	((x) * 1000)		/* kilobits/sec. */
-#define	IF_Mbps(x)	(IF_Kbps((x) * 1000))	/* megabits/sec. */
-#define	IF_Gbps(x)	(IF_Mbps((x) * 1000))	/* gigabits/sec. */
+#define	IF_Kbps(x)	((x) * 1000ULL)			/* kilobits/sec. */
+#define	IF_Mbps(x)	(IF_Kbps((x) * 1000ULL))	/* megabits/sec. */
+#define	IF_Gbps(x)	(IF_Mbps((x) * 1000ULL))	/* gigabits/sec. */
 
 /* Capabilities that interfaces can advertise. */
 					/* 0x01 .. 0x40 were previously used */

Reply via email to