MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tun_caps_changed

Function tun_caps_changed

freebsd/net/if_tuntap.c:1223–1239  ·  view source on GitHub ↗

* To be called under TUN_LOCK. Update ifp->if_hwassist according to the * current value of ifp->if_capenable. */

Source from the content-addressed store, hash-verified

1221 * current value of ifp->if_capenable.
1222 */
1223static void
1224tun_caps_changed(struct ifnet *ifp)
1225{
1226 uint64_t hwassist = 0;
1227
1228 TUN_LOCK_ASSERT((struct tuntap_softc *)ifp->if_softc);
1229 if (ifp->if_capenable & IFCAP_TXCSUM)
1230 hwassist |= CSUM_TCP | CSUM_UDP;
1231 if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
1232 hwassist |= CSUM_TCP_IPV6
1233 | CSUM_UDP_IPV6;
1234 if (ifp->if_capenable & IFCAP_TSO4)
1235 hwassist |= CSUM_IP_TSO;
1236 if (ifp->if_capenable & IFCAP_TSO6)
1237 hwassist |= CSUM_IP6_TSO;
1238 ifp->if_hwassist = hwassist;
1239}
1240
1241/*
1242 * To be called under TUN_LOCK. Update tp->tun_vhdrlen and adjust

Callers 2

tun_vnethdr_setFunction · 0.85
tunifioctlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected