summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-01-03 22:45:53 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-01-03 22:45:53 +0000
commit143225e444133568ff10359ad0edd0ce748e3c1f (patch)
treed98fb8b8a5057e74fb176aaa2aabbbc0111672c6 /sys/dev
parentbb3ba0fb884a12df695a21f102313bd4f92b3efa (diff)
- make sure int is in running state before touching the multicast filters
- call foo_setmulti only instead of init'ing the chip - don't overwrite potential error return with success when calling ether_addmulti/ether_delmulti ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/if_aue.c14
-rw-r--r--sys/dev/usb/if_axe.c3
-rw-r--r--sys/dev/usb/if_cue.c6
-rw-r--r--sys/dev/usb/if_kue.c6
-rw-r--r--sys/dev/usb/if_udav.c12
-rw-r--r--sys/dev/usb/if_url.c9
6 files changed, 27 insertions, 23 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 649cee98114..0bf62fa3875 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aue.c,v 1.37 2004/11/10 10:14:48 grange Exp $ */
+/* $OpenBSD: if_aue.c,v 1.38 2005/01/03 22:45:52 brad Exp $ */
/* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1621,18 +1621,14 @@ aue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
case SIOCADDMULTI:
case SIOCDELMULTI:
error = (command == SIOCADDMULTI) ?
-#if defined(__NetBSD__)
- ether_addmulti(ifr, &sc->aue_ec) :
- ether_delmulti(ifr, &sc->aue_ec);
-#else
ether_addmulti(ifr, &sc->arpcom) :
ether_delmulti(ifr, &sc->arpcom);
-#endif
+
if (error == ENETRESET) {
- aue_init(sc);
+ if (ifp->if_flags & IFF_RUNNING)
+ aue_setmulti(sc);
+ error = 0;
}
- aue_setmulti(sc);
- error = 0;
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index ff482a56aab..59888aa212e 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axe.c,v 1.21 2004/12/31 02:21:32 dlg Exp $ */
+/* $OpenBSD: if_axe.c,v 1.22 2005/01/03 22:45:52 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -1252,6 +1252,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->arpcom) :
ether_delmulti(ifr, &sc->arpcom);
+
if (error == ENETRESET) {
/*
* Multicast list has changed; set the hardware
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 31777cb56f6..ef462c1e881 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cue.c,v 1.23 2004/11/10 10:14:48 grange Exp $ */
+/* $OpenBSD: if_cue.c,v 1.24 2005/01/03 22:45:52 brad Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1218,12 +1218,14 @@ cue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = (command == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->arpcom) :
ether_delmulti(ifr, &sc->arpcom);
+
if (error == ENETRESET) {
/*
* Multicast list has changed; set the hardware
* filter accordingly.
*/
- cue_setmulti(sc);
+ if (ifp->if_flags & IFF_RUNNING)
+ cue_setmulti(sc);
error = 0;
}
break;
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 3f2a126b5b8..1dabf799918 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kue.c,v 1.33 2004/12/12 06:21:35 deraadt Exp $ */
+/* $OpenBSD: if_kue.c,v 1.34 2005/01/03 22:45:52 brad Exp $ */
/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1177,12 +1177,14 @@ kue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = (command == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->arpcom) :
ether_delmulti(ifr, &sc->arpcom);
+
if (error == ENETRESET) {
/*
* Multicast list has changed; set the hardware
* filter accordingly.
*/
- kue_setmulti(sc);
+ if (ifp->if_flags & IFF_RUNNING)
+ kue_setmulti(sc);
error = 0;
}
break;
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index b620217507a..4ef3b5654c7 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udav.c,v 1.8 2004/12/30 07:43:09 dlg Exp $ */
+/* $OpenBSD: if_udav.c,v 1.9 2005/01/03 22:45:52 brad Exp $ */
/* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -1282,10 +1282,12 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ac) :
ether_delmulti(ifr, &sc->sc_ac);
- if (error == ENETRESET)
- udav_init(ifp);
- udav_setmulti(sc);
- error = 0;
+
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ udav_setmulti(sc);
+ error = 0;
+ }
break;
default:
error = EINVAL;
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index 7dc72032df5..c5305137e74 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.19 2004/11/17 05:00:28 deraadt Exp $ */
+/* $OpenBSD: if_url.c,v 1.20 2005/01/03 22:45:52 brad Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -1196,11 +1196,12 @@ url_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ac) :
ether_delmulti(ifr, &sc->sc_ac);
+
if (error == ENETRESET) {
- url_init(ifp);
+ if (ifp->if_flags & IFF_RUNNING)
+ url_setmulti(sc);
+ error = 0;
}
- url_setmulti(sc);
- error = 0;
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA: