diff options
author | yongari <yongari@FreeBSD.org> | 2007-04-18 00:40:43 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2007-04-18 00:40:43 +0000 |
commit | 8c9ec0ed497bc6067b306bca51ac84e2a8b520f1 (patch) | |
tree | 76cd6874bee43fcc95f1df2f29d8b234c4fc6fd5 /sys/dev | |
parent | b85dc1755da55a6af9894519f2f87dbdc3a872e2 (diff) | |
download | FreeBSD-src-8c9ec0ed497bc6067b306bca51ac84e2a8b520f1.zip FreeBSD-src-8c9ec0ed497bc6067b306bca51ac84e2a8b520f1.tar.gz |
Don't reinitialize the hardware if only PROMISC flag was changed.
Previously whenever PROMISC mode turned on/off link renegotiation
occurs and it could resulted in network unavailability for serveral
seconds.(Depending on switch STP settings it could last several tens
seconds.)
Reported by: Prokofiev S.P. < proks AT logos DOT uptel DOT net >
Tested by: Prokofiev S.P. < proks AT logos DOT uptel DOT net >
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/re/if_re.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index ceae240..83e743a 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -2509,10 +2509,18 @@ re_ioctl(ifp, command, data) break; case SIOCSIFFLAGS: RL_LOCK(sc); - if (ifp->if_flags & IFF_UP) - re_init_locked(sc); - else if (ifp->if_drv_flags & IFF_DRV_RUNNING) - re_stop(sc); + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (((ifp->if_flags ^ sc->rl_if_flags) + & IFF_PROMISC) != 0) + re_setmulti(sc); + } else + re_init_locked(sc); + } else { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + re_stop(sc); + } + sc->rl_if_flags = ifp->if_flags; RL_UNLOCK(sc); break; case SIOCADDMULTI: |