Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/net Pull up following revision(s) (requested by msait...



details:   https://anonhg.NetBSD.org/src/rev/cc32dfae0e05
branches:  netbsd-6
changeset: 776945:cc32dfae0e05
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Apr 16 06:27:33 2015 +0000

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

diffstat:

 sys/net/if.h |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (24 lines):

diff -r ceca609dc5d8 -r cc32dfae0e05 sys/net/if.h
--- a/sys/net/if.h      Thu Apr 16 06:24:16 2015 +0000
+++ b/sys/net/if.h      Thu Apr 16 06:27:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.154 2011/10/25 22:26:18 dyoung Exp $  */
+/*     $NetBSD: if.h,v 1.154.8.1 2015/04/16 06:27:33 snj Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -381,11 +381,10 @@
 
 /*
  * Some convenience macros used for setting ifi_baudrate.
- * XXX 1000 vs. 1024? --thorpej%NetBSD.org@localhost
  */
-#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. */
 #define        IFCAP_TSOv4             0x00080 /* can do TCPv4 segmentation offload */



Home | Main Index | Thread Index | Old Index