Module Name:    src
Committed By:   msaitoh
Date:           Thu Aug  1 15:21:50 UTC 2019

Modified Files:
        src/sys/dev/ic: rtl81x9.c

Log Message:
 Use unsigned in rtk_setmulti() to avoid undefined behavoir. Found bk kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ic/rtl81x9.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/dev/ic/rtl81x9.c
diff -u src/sys/dev/ic/rtl81x9.c:1.106 src/sys/dev/ic/rtl81x9.c:1.107
--- src/sys/dev/ic/rtl81x9.c:1.106	Tue May 28 07:41:48 2019
+++ src/sys/dev/ic/rtl81x9.c	Thu Aug  1 15:21:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl81x9.c,v 1.106 2019/05/28 07:41:48 msaitoh Exp $	*/
+/*	$NetBSD: rtl81x9.c,v 1.107 2019/08/01 15:21:50 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.106 2019/05/28 07:41:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.107 2019/08/01 15:21:50 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -561,9 +561,9 @@ rtk_setmulti(struct rtk_softc *sc)
 
 		h = rtk_calchash(enm->enm_addrlo);
 		if (h < 32)
-			hashes[0] |= (1 << h);
+			hashes[0] |= __BIT(h);
 		else
-			hashes[1] |= (1 << (h - 32));
+			hashes[1] |= __BIT(h - 32);
 		mcnt++;
 		ETHER_NEXT_MULTI(step, enm);
 	}

Reply via email to