diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-01-15 05:24:13 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-01-15 05:24:13 +0000 |
commit | 89df0e6b8b27747dc883f3de9e8f46b10fcedc39 (patch) | |
tree | a292b90e17b1cad700ae6fa40a061e782999a21f /sys/dev/ic | |
parent | 8c0a544eeaf396cc953120df64521d1b451b7b18 (diff) |
make sure interface is in RUNNING state before touching the multicast filters
From NetBSD
NetBSD PR 27678 for details
ok mcbride@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/am7990.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/atw.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/awi.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/dc.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/dp8390.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/elink3.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/fxp.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/gem.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/hme.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/i82596.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/if_wi.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/lemac.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/mtd8xx.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/re.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/smc91cxx.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/xl.c | 12 |
17 files changed, 57 insertions, 39 deletions
diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c index 5c564d8003b..8447a7aa1a6 100644 --- a/sys/dev/ic/am7990.c +++ b/sys/dev/ic/am7990.c @@ -1,4 +1,4 @@ -/* $OpenBSD: am7990.c,v 1.37 2005/01/01 03:59:52 brad Exp $ */ +/* $OpenBSD: am7990.c,v 1.38 2005/01/15 05:24:10 brad Exp $ */ /* $NetBSD: am7990.c,v 1.22 1996/10/13 01:37:19 christos Exp $ */ /*- @@ -909,7 +909,8 @@ am7990_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - am7990_reset(sc); + if (ifp->if_flags & IFF_RUNNING) + am7990_reset(sc); error = 0; } break; diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 07e5da5f304..ddf80afe40f 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.27 2004/12/31 04:27:52 jsg Exp $ */ +/* $OpenBSD: atw.c,v 1.28 2005/01/15 05:24:10 brad Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -4007,7 +4007,7 @@ atw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #endif if (error == ENETRESET) { - if (ATW_IS_ENABLED(sc)) + if (ifp->if_flags & IFF_RUNNING) atw_filter_setup(sc); /* do not rescan */ error = 0; } diff --git a/sys/dev/ic/awi.c b/sys/dev/ic/awi.c index 198ca7cb7b9..28a0f72c701 100644 --- a/sys/dev/ic/awi.c +++ b/sys/dev/ic/awi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: awi.c,v 1.15 2004/11/23 21:12:23 fgsch Exp $ */ +/* $OpenBSD: awi.c,v 1.16 2005/01/15 05:24:10 brad Exp $ */ /* $NetBSD: awi.c,v 1.26 2000/07/21 04:48:55 onoe Exp $ */ /*- @@ -526,7 +526,7 @@ awi_ioctl(ifp, cmd, data) * Do not rescan BSS. Rather, just reset multicast filter. */ if (error == ENETRESET) { - if (sc->sc_enabled) + if (ifp->if_flags & IFF_RUNNING) error = awi_init(sc); else error = 0; diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 42101cb715c..a0866b70206 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.79 2005/01/14 15:04:51 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.80 2005/01/15 05:24:11 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -3096,7 +3096,8 @@ dc_ioctl(ifp, command, data) * Multicast list has changed; set the hardware * filter accordingly. */ - dc_setfilt(sc); + if (ifp->if_flags & IFF_RUNNING) + dc_setfilt(sc); error = 0; } break; diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index 8f8ea1572ab..46b43b40393 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dp8390.c,v 1.26 2004/06/06 17:56:36 mcbride Exp $ */ +/* $OpenBSD: dp8390.c,v 1.27 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */ /* @@ -902,8 +902,10 @@ dp8390_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - dp8390_stop(sc); /* XXX for ds_setmcaf? */ - dp8390_init(sc); + if (ifp->if_flags & IFF_RUNNING) { + dp8390_stop(sc); /* XXX for ds_setmcaf? */ + dp8390_init(sc); + } error = 0; } break; diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 1cc9187ae0b..d6f01ca6174 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.62 2004/05/12 06:35:10 tedu Exp $ */ +/* $OpenBSD: elink3.c,v 1.63 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -1555,7 +1555,8 @@ epioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - epreset(sc); + if (ifp->if_flags & IFF_RUNNING) + epreset(sc); error = 0; } break; diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 7c0cbb78c65..70378d7557c 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.64 2005/01/14 18:14:12 deraadt Exp $ */ +/* $OpenBSD: fxp.c,v 1.65 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -1730,7 +1730,8 @@ fxp_ioctl(ifp, command, data) * Multicast list has changed; set the hardware * filter accordingly. */ - fxp_init(sc); + if (ifp->if_flags & IFF_RUNNING) + fxp_init(sc); error = 0; } break; diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 1f0b7daeee8..28dc070f19a 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.39 2004/09/27 23:59:27 brad Exp $ */ +/* $OpenBSD: gem.c,v 1.40 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -1432,7 +1432,8 @@ gem_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - gem_init(ifp); + if (ifp->if_flags & IFF_RUNNING) + gem_init(ifp); error = 0; } break; diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index be104208907..2f5e41f1602 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.33 2004/09/28 00:21:23 brad Exp $ */ +/* $OpenBSD: hme.c,v 1.34 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */ /*- @@ -1188,7 +1188,8 @@ hme_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - hme_setladrf(sc); + if (ifp->if_flags & IFF_RUNNING) + hme_setladrf(sc); error = 0; } break; diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c index 769e2a7ecbf..c163fff852e 100644 --- a/sys/dev/ic/i82596.c +++ b/sys/dev/ic/i82596.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i82596.c,v 1.24 2004/05/12 06:35:10 tedu Exp $ */ +/* $OpenBSD: i82596.c,v 1.25 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */ /*- @@ -1945,7 +1945,8 @@ i82596_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware filter * accordingly. */ - ie_mc_reset(sc); + if (ifp->if_flags & IFF_RUNNING) + ie_mc_reset(sc); error = 0; } break; diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 792a7198456..add84ce8de6 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.114 2004/12/22 02:19:11 millert Exp $ */ +/* $OpenBSD: if_wi.c,v 1.115 2005/01/15 05:24:11 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -127,7 +127,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.114 2004/12/22 02:19:11 millert Exp $"; + "$OpenBSD: if_wi.c,v 1.115 2005/01/15 05:24:11 brad Exp $"; #endif /* lint */ #ifdef foo @@ -1653,12 +1653,14 @@ wi_ioctl(ifp, command, data) error = (command == SIOCADDMULTI) ? ether_addmulti(ifr, &sc->sc_arpcom) : ether_delmulti(ifr, &sc->sc_arpcom); + if (error == ENETRESET) { /* * Multicast list has changed; set the hardware filter * accordingly. */ - wi_setmulti(sc); + if (ifp->if_flags & IFF_RUNNING) + wi_setmulti(sc); error = 0; } break; diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c index d2ccb0ed40a..893302ef04f 100644 --- a/sys/dev/ic/lemac.c +++ b/sys/dev/ic/lemac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lemac.c,v 1.5 2003/10/30 02:30:48 itojun Exp $ */ +/* $OpenBSD: lemac.c,v 1.6 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */ /*- @@ -846,7 +846,8 @@ lemac_ifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (error == ENETRESET) { /* Reset multicast filtering. */ - lemac_init(sc); + if (ifp->if_flags & IFF_RUNNING) + lemac_init(sc); error = 0; } break; diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c index df72c1cd56b..20789d46c00 100644 --- a/sys/dev/ic/mtd8xx.c +++ b/sys/dev/ic/mtd8xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtd8xx.c,v 1.7 2004/09/28 04:37:32 brad Exp $ */ +/* $OpenBSD: mtd8xx.c,v 1.8 2005/01/15 05:24:11 brad Exp $ */ /* * Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru> @@ -631,7 +631,8 @@ mtd_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * Multicast list has changed; set the hardware * filter accordingly. */ - mtd_setmulti(sc); + if (ifp->if_flags & IFF_RUNNING) + mtd_setmulti(sc); error = 0; } break; diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index c8eb9fc0335..b79c4f89af8 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.2 2005/01/14 01:32:45 pvalchev Exp $ */ +/* $OpenBSD: re.c,v 1.3 2005/01/15 05:24:11 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1896,7 +1896,8 @@ re_ioctl(ifp, command, data) * Multicast list has changed; set the hardware * filter accordingly. */ - re_setmulti(sc); + if (ifp->if_flags & IFF_RUNNING) + re_setmulti(sc); error = 0; } break; diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 9aa4e907c53..d5f90fcb49c 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.35 2004/11/21 18:50:43 brad Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.36 2005/01/15 05:24:11 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1127,7 +1127,8 @@ int rl_ioctl(ifp, command, data) * Multicast list has changed; set the hardware * filter accordingly. */ - rl_setmulti(sc); + if (ifp->if_flags & IFF_RUNNING) + rl_setmulti(sc); error = 0; } break; diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index 5caa5ca0c9c..afc1ec6a141 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smc91cxx.c,v 1.18 2004/05/12 06:35:10 tedu Exp $ */ +/* $OpenBSD: smc91cxx.c,v 1.19 2005/01/15 05:24:11 brad Exp $ */ /* $NetBSD: smc91cxx.c,v 1.11 1998/08/08 23:51:41 mycroft Exp $ */ /*- @@ -1059,7 +1059,8 @@ smc91cxx_ioctl(ifp, cmd, data) * Multicast list has changed; set the hardware * filter accordingly. */ - smc91cxx_reset(sc); + if (ifp->if_flags & IFF_RUNNING) + smc91cxx_reset(sc); error = 0; } break; diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index f82e3d2c7bc..4d3eceb31ae 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.61 2004/11/01 02:03:45 brad Exp $ */ +/* $OpenBSD: xl.c,v 1.62 2005/01/15 05:24:11 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2464,10 +2464,12 @@ xl_ioctl(ifp, command, data) * Multicast list has changed; set the hardware * filter accordingly. */ - if (sc->xl_type == XL_TYPE_905B) - xl_setmulti_hash(sc); - else - xl_setmulti(sc); + if (ifp->if_flags & IFF_RUNNING) { + if (sc->xl_type == XL_TYPE_905B) + xl_setmulti_hash(sc); + else + xl_setmulti(sc); + } error = 0; } break; |