View | Details | Raw Unified | Return to bug 231151 | Differences between
and this patch

Collapse All | Expand All

(-)iflib.c (-3 / +17 lines)
Lines 4223-4231 Link Here
4223
	}
4223
	}
4224
	case SIOCSIFCAP:
4224
	case SIOCSIFCAP:
4225
	{
4225
	{
4226
		int mask, setmask;
4226
		int mask, setmask, oldmask;
4227
4227
4228
		mask = ifr->ifr_reqcap ^ if_getcapenable(ifp);
4228
		oldmask = if_getcapenable(ifp);
4229
		mask = ifr->ifr_reqcap ^ oldmask;
4230
		mask &= ctx->ifc_softc_ctx.isc_capabilities;
4229
		setmask = 0;
4231
		setmask = 0;
4230
#ifdef TCP_OFFLOAD
4232
#ifdef TCP_OFFLOAD
4231
		setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6);
4233
		setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6);
Lines 4232-4239 Link Here
4232
#endif
4234
#endif
4233
		setmask |= (mask & IFCAP_FLAGS);
4235
		setmask |= (mask & IFCAP_FLAGS);
4234
4236
4235
		if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
4237
		/*
4238
		 * If we're disabling any RX csum, disable all the ones
4239
		 * the driver supports.  This assumes all supported are
4240
		 * enabled.
4241
		 * 
4242
		 * Otherwise, if they've changed, enable all of them.
4243
		 */
4244
		if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) <
4245
		    (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)))
4246
			setmask &= ~((IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6) & IFCAP_FLAGS);
4247
		else if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) !=
4248
		    (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)))
4236
			setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
4249
			setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
4250
4237
		if ((mask & IFCAP_WOL) &&
4251
		if ((mask & IFCAP_WOL) &&
4238
		    (if_getcapabilities(ifp) & IFCAP_WOL) != 0)
4252
		    (if_getcapabilities(ifp) & IFCAP_WOL) != 0)
4239
			setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC));
4253
			setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC));

Return to bug 231151