diff options
author | yar <yar@FreeBSD.org> | 2004-05-23 21:05:08 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-05-23 21:05:08 +0000 |
commit | 170d03a0c9fddf1f1a42da03139f4e14bf1449e4 (patch) | |
tree | 375592891cd6bfe9116c605a163f03aadcba537f /sys/pci | |
parent | 747b4b5ae0b8a831f8be8364825620f94dcb9ad1 (diff) | |
download | FreeBSD-src-170d03a0c9fddf1f1a42da03139f4e14bf1449e4.zip FreeBSD-src-170d03a0c9fddf1f1a42da03139f4e14bf1449e4.tar.gz |
A handler for ioctl(SIOCSIFCAP) should not alter a bit in
if_capenable unless the interface driver is actually able
to toggle the respective capability on and off.
Reviewed by: ru
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_dc.c | 3 | ||||
-rw-r--r-- | sys/pci/if_rl.c | 3 | ||||
-rw-r--r-- | sys/pci/if_sis.c | 3 | ||||
-rw-r--r-- | sys/pci/if_ste.c | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 01ac05a..0130b9d 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -3708,7 +3708,8 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) #endif break; case SIOCSIFCAP: - ifp->if_capenable = ifr->ifr_reqcap; + ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING; break; default: error = ether_ioctl(ifp, command, data); diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index eee7976..5f0d0d2 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1830,7 +1830,8 @@ rl_ioctl(ifp, command, data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - ifp->if_capenable = ifr->ifr_reqcap; + ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING; break; default: error = ether_ioctl(ifp, command, data); diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index 8aef8db..f8c92c9 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -2340,7 +2340,8 @@ sis_ioctl(ifp, command, data) SIS_UNLOCK(sc); break; case SIOCSIFCAP: - ifp->if_capenable = ifr->ifr_reqcap; + ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING; break; default: error = ether_ioctl(ifp, command, data); diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index 2d3f6dc..5f0e013 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -1555,7 +1555,8 @@ ste_ioctl(ifp, command, data) error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - ifp->if_capenable = ifr->ifr_reqcap; + ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING; break; default: error = ether_ioctl(ifp, command, data); |