From 53a8110974390f15e2334d6eca2d3b27760b4b4a Mon Sep 17 00:00:00 2001 From: msaitoh Date: Wed, 18 Sep 2019 00:09:42 +0000 Subject: [PATCH] Use unsigned to avoid undefined behavior in lii_setmulti(). --- sys/dev/pci/if_lii.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index 33c54f8e4cc9..288dd520aaf9 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_lii.c,v 1.26 2019/05/30 02:32:18 msaitoh Exp $ */ +/* $NetBSD: if_lii.c,v 1.27 2019/09/18 00:09:42 msaitoh Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.26 2019/05/30 02:32:18 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.27 2019/09/18 00:09:42 msaitoh Exp $"); #include @@ -1186,10 +1186,10 @@ lii_setmulti(struct lii_softc *sc) crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN); - if (crc & (1 << 31)) - mht1 |= (1 << ((crc >> 26) & 0x0000001f)); + if (crc & (1U << 31)) + mht1 |= (1U << ((crc >> 26) & 0x0000001f)); else - mht0 |= (1 << ((crc >> 26) & 0x0000001f)); + mht0 |= (1U << ((crc >> 26) & 0x0000001f)); ETHER_NEXT_MULTI(step, enm); }