Correctly switch IFCAP_VLAN_HWTAGGING on and off.
Reported & tested by: Peter Blok <pblok bsd4all.org>
This commit is contained in:
parent
e2779391fa
commit
f051cb85e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156241
@ -2335,7 +2335,10 @@ re_ioctl(ifp, command, data)
|
|||||||
break;
|
break;
|
||||||
case SIOCSIFCAP:
|
case SIOCSIFCAP:
|
||||||
{
|
{
|
||||||
int mask = ifr->ifr_reqcap ^ ifp->if_capenable;
|
int mask, reinit;
|
||||||
|
|
||||||
|
mask = ifr->ifr_reqcap ^ ifp->if_capenable;
|
||||||
|
reinit = 0;
|
||||||
#ifdef DEVICE_POLLING
|
#ifdef DEVICE_POLLING
|
||||||
if (mask & IFCAP_POLLING) {
|
if (mask & IFCAP_POLLING) {
|
||||||
if (ifr->ifr_reqcap & IFCAP_POLLING) {
|
if (ifr->ifr_reqcap & IFCAP_POLLING) {
|
||||||
@ -2359,16 +2362,19 @@ re_ioctl(ifp, command, data)
|
|||||||
}
|
}
|
||||||
#endif /* DEVICE_POLLING */
|
#endif /* DEVICE_POLLING */
|
||||||
if (mask & IFCAP_HWCSUM) {
|
if (mask & IFCAP_HWCSUM) {
|
||||||
RL_LOCK(sc);
|
ifp->if_capenable ^= IFCAP_HWCSUM;
|
||||||
ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_HWCSUM;
|
|
||||||
if (ifp->if_capenable & IFCAP_TXCSUM)
|
if (ifp->if_capenable & IFCAP_TXCSUM)
|
||||||
ifp->if_hwassist = RE_CSUM_FEATURES;
|
ifp->if_hwassist = RE_CSUM_FEATURES;
|
||||||
else
|
else
|
||||||
ifp->if_hwassist = 0;
|
ifp->if_hwassist = 0;
|
||||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
reinit = 1;
|
||||||
re_init_locked(sc);
|
|
||||||
RL_UNLOCK(sc);
|
|
||||||
}
|
}
|
||||||
|
if (mask & IFCAP_VLAN_HWTAGGING) {
|
||||||
|
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
|
||||||
|
reinit = 1;
|
||||||
|
}
|
||||||
|
if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING)
|
||||||
|
re_init(sc);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user