XOR pt. 2

From: Michael McConville <mmcco_at_mykolab.com>
Date: Fri, 11 Dec 2015 14:42:05 -0500
Note that IFCAP_HWCSUM has two bits set. Because of this, it doesn't XOR
cleanly in the current if-else condition, but I'm not sure whether that
was intended. I just wanted to pass this by people in case it was a
logical bug.


--- dev/ixgb/if_ixgb.c.orig
+++ dev/ixgb/if_ixgb.c
_at__at_ -599,10 +599,7 _at__at_ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD
 		}
 #endif /* DEVICE_POLLING */
 		if (mask & IFCAP_HWCSUM) {
-			if (IFCAP_HWCSUM & ifp->if_capenable)
-				ifp->if_capenable &= ~IFCAP_HWCSUM;
-			else
-				ifp->if_capenable |= IFCAP_HWCSUM;
+			ifp->if_capenable ^= IFCAP_HWCSUM;
 			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
 				ixgb_init(adapter);
 		}
Received on Fri Dec 11 2015 - 18:42:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:01 UTC