summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-08-15 16:56:43 +0000
committeryar <yar@FreeBSD.org>2006-08-15 16:56:43 +0000
commita620e8e32b4fc6903ee03784c0c3613aefffd258 (patch)
tree04cf26c0ca45d82f39070c79df00fa80cc80f432 /sys/net/if_vlan.c
parent0d834c1effeea8c40bf1c914d536c858ef717dd3 (diff)
downloadFreeBSD-src-a620e8e32b4fc6903ee03784c0c3613aefffd258.zip
FreeBSD-src-a620e8e32b4fc6903ee03784c0c3613aefffd258.tar.gz
Make it a tad easier to base other encapsulation schemes on this driver
by restoring the ifv_proto field in the vlan softc and putting it to use this time. It's a good companion for ifv_encaplen, which has already been used throughout this driver.
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index fb19266..3a02d04 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -108,11 +108,13 @@ struct ifvlan {
int ifvm_encaplen; /* encapsulation length */
int ifvm_mtufudge; /* MTU fudged by this much */
int ifvm_mintu; /* min transmission unit */
+ uint16_t ifvm_proto; /* encapsulation ethertype */
uint16_t ifvm_tag; /* tag to apply on packets leaving if */
} ifv_mib;
SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead;
LIST_ENTRY(ifvlan) ifv_list;
};
+#define ifv_proto ifv_mib.ifvm_proto
#define ifv_tag ifv_mib.ifvm_tag
#define ifv_encaplen ifv_mib.ifvm_encaplen
#define ifv_mtufudge ifv_mib.ifvm_mtufudge
@@ -888,7 +890,7 @@ vlan_start(struct ifnet *ifp)
mtod(m, char *), ETHER_HDR_LEN);
evl = mtod(m, struct ether_vlan_header *);
evl->evl_proto = evl->evl_encap_proto;
- evl->evl_encap_proto = htons(ETHERTYPE_VLAN);
+ evl->evl_encap_proto = htons(ifv->ifv_proto);
evl->evl_tag = htons(ifv->ifv_tag);
#ifdef DEBUG
printf("%s: %*D\n", __func__, (int)sizeof(*evl),
@@ -944,10 +946,6 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
return;
}
evl = mtod(m, struct ether_vlan_header *);
- KASSERT(ntohs(evl->evl_encap_proto) == ETHERTYPE_VLAN,
- ("%s: bad encapsulation protocol (%u)",
- __func__, ntohs(evl->evl_encap_proto)));
-
tag = EVL_VLANOFTAG(ntohs(evl->evl_tag));
/*
@@ -1058,6 +1056,7 @@ exists:
if (error)
goto done;
#endif
+ ifv->ifv_proto = ETHERTYPE_VLAN;
ifv->ifv_encaplen = ETHER_VLAN_ENCAP_LEN;
ifv->ifv_mintu = ETHERMIN;
ifv->ifv_pflags = 0;
OpenPOWER on IntegriCloud