Inherit IPv6 checksum offloading flags to vlan interfaces.

if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the
parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the
parent interface. Do the same for IPv6 checksum offloading flags.

Reported by:	Harry Schmalzbauer
Reviewed by:	np, gnn
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10356
This commit is contained in:
Andrey V. Elsukov 2017-04-11 19:23:25 +00:00
parent 7faa0d213b
commit 070f87e878

View File

@ -1555,13 +1555,16 @@ vlan_capabilities(struct ifvlan *ifv)
* offloading requires hardware VLAN tagging.
*/
if (p->if_capabilities & IFCAP_VLAN_HWCSUM)
ifp->if_capabilities = p->if_capabilities & IFCAP_HWCSUM;
ifp->if_capabilities =
p->if_capabilities & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
if (p->if_capenable & IFCAP_VLAN_HWCSUM &&
p->if_capenable & IFCAP_VLAN_HWTAGGING) {
ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM;
ifp->if_capenable =
p->if_capenable & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP |
CSUM_UDP | CSUM_SCTP);
CSUM_UDP | CSUM_SCTP | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 |
CSUM_SCTP_IPV6);
} else {
ifp->if_capenable = 0;
ifp->if_hwassist = 0;