From 611d6a1573b295040c444fb5ed978cb7a09ca6a1 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 11 Jan 2000 18:09:19 +0000 Subject: [PATCH] Straighten out the logic in kue_setmulti() a little (the case where we have no multicast entries to add is not handled right). --- sys/dev/usb/if_kue.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 2371a879c393..231437497d5e 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -343,21 +343,20 @@ static void kue_setmulti(sc) * If there are too many addresses for the * internal filter, switch over to allmulti mode. */ - if (i == KUE_MCFILTCNT(sc)) { - i = 0; + if (i == KUE_MCFILTCNT(sc)) break; - } bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), KUE_MCFILT(sc, i), ETHER_ADDR_LEN); i++; } - if (i) { + if (i == KUE_MCFILTCNT(sc)) + sc->kue_rxfilt |= KUE_RXFILT_ALLMULTI; + else { sc->kue_rxfilt |= KUE_RXFILT_MULTICAST; kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MCAST_FILTERS, i, sc->kue_mcfilters, i * ETHER_ADDR_LEN); - } else - sc->kue_rxfilt |= KUE_RXFILT_ALLMULTI; + } kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt);