summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-05-23 21:05:08 +0000
committeryar <yar@FreeBSD.org>2004-05-23 21:05:08 +0000
commit170d03a0c9fddf1f1a42da03139f4e14bf1449e4 (patch)
tree375592891cd6bfe9116c605a163f03aadcba537f /sys/dev/re
parent747b4b5ae0b8a831f8be8364825620f94dcb9ad1 (diff)
downloadFreeBSD-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/dev/re')
-rw-r--r--sys/dev/re/if_re.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 440a5be..c28728f 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2315,7 +2315,9 @@ re_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_HWCSUM | IFCAP_POLLING);
+ ifp->if_capenable |=
+ ifr->ifr_reqcap & (IFCAP_HWCSUM | IFCAP_POLLING);
if (ifp->if_capenable & IFCAP_TXCSUM)
ifp->if_hwassist = RE_CSUM_FEATURES;
else
OpenPOWER on IntegriCloud