mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
This commit is contained in:
parent
a5820ecb77
commit
25fbb2c38c
8 changed files with 17 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -2496,7 +2496,8 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||
break;
|
||||
|
||||
case SIOCSIFCAP:
|
||||
ifp->if_capenable = ifr->ifr_reqcap;
|
||||
ifp->if_capenable &= ~IFCAP_POLLING;
|
||||
ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -2167,7 +2167,8 @@ nge_ioctl(ifp, command, data)
|
|||
}
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue