From 25fbb2c38c0647f38d3227b80cdd85e4251d7410 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Sun, 23 May 2004 21:05:08 +0000 Subject: 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 --- sys/dev/re/if_re.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/dev/re') diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 440a5bed38acc..c28728f144be1 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 -- cgit v1.3