This commit is contained in:
purplerain 2023-05-16 22:16:59 +00:00
parent ab90ba3a7c
commit 9e5eddc6af
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
57 changed files with 838 additions and 537 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_vlan.c,v 1.214 2023/04/26 00:14:21 jan Exp $ */
/* $OpenBSD: if_vlan.c,v 1.215 2023/05/16 14:32:54 jan Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
@ -536,7 +536,8 @@ vlan_up(struct vlan_softc *sc)
* Chips that can do hardware-assisted VLAN encapsulation, can
* calculate the correct checksum for VLAN tagged packets.
*/
ifp->if_capabilities = ifp0->if_capabilities & IFCAP_CSUM_MASK;
ifp->if_capabilities = ifp0->if_capabilities &
(IFCAP_CSUM_MASK | IFCAP_TSOv4 | IFCAP_TSOv6);
}
/* commit the sc */
@ -560,9 +561,6 @@ vlan_up(struct vlan_softc *sc)
/* configure the parent to handle packets for this vlan */
vlan_multi_apply(sc, ifp0, SIOCADDMULTI);
/* Inherit flags from parent interface. */
vlan_flags_from_parent(ifp0, IFXF_TSO);
/* we're running now */
SET(ifp->if_flags, IFF_RUNNING);
vlan_link_state(sc, ifp0->if_link_state, ifp0->if_baudrate);
@ -965,28 +963,6 @@ vlan_del_parent(struct vlan_softc *sc)
return (0);
}
void
vlan_flags_from_parent(struct ifnet *ifp0, int flags)
{
struct vlan_softc *sc;
int i;
for (i = 0; i < TAG_HASH_SIZE; i++) {
SMR_SLIST_FOREACH_LOCKED(sc, &vlan_tagh[i], sc_list) {
/* vlan and tso only works with hw tagging */
if (!ISSET(ifp0->if_capabilities, IFCAP_VLAN_HWTAGGING))
CLR(flags, IFXF_TSO);
if (sc->sc_ifidx0 == ifp0->if_index) {
if (ISSET(ifp0->if_xflags, flags))
SET(sc->sc_if.if_xflags, flags);
else
CLR(sc->sc_if.if_xflags, flags);
}
}
}
}
int
vlan_set_compat(struct ifnet *ifp, struct ifreq *ifr)
{