double vlans - once again.

Brooks Davis brooks at one-eyed-alien.net
Mon Dec 20 10:28:22 PST 2004


On Sat, Dec 18, 2004 at 08:57:58PM +0200, Mihail  Balikov wrote:
> I have done this 2 years ago for FreeBSD 4-STABLE
> 
> in sys/net/if_vlan.c in vlan_config(), replace
> 
>        if (p->if_data.ifi_type != IFT_ETHER)
>                 return EPROTONOSUPPORT;
> 
> with
> 
>        if (p->if_data.ifi_type != IFT_ETHER &&
>            p->if_data.ifi_type != IFT_L2VLAN)
>                 return EPROTONOSUPPORT;

Hmm, for -current this appears incomplete.  I think the following is
what is needed.  Any one in a position to test this?

-- Brooks

Index: if_vlan.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_vlan.c,v
retrieving revision 1.73
diff -u -p -r1.73 if_vlan.c
--- if_vlan.c	15 Aug 2004 06:24:42 -0000	1.73
+++ if_vlan.c	20 Dec 2004 18:25:48 -0000
@@ -273,7 +273,8 @@ vlan_clone_match_ethertag(struct if_clon
 	/* Check for <etherif>.<vlan> style interface names. */
 	IFNET_RLOCK();
 	TAILQ_FOREACH(ifp, &ifnet, if_link) {
-		if (ifp->if_type != IFT_ETHER)
+		if (ifp->if_type != IFT_ETHER &&
+		    ifp->if_type != IFT_L2VLAN)
 			continue;
 		if (strncmp(ifp->if_xname, name, strlen(ifp->if_xname)) != 0)
 			continue;
@@ -566,6 +567,7 @@ vlan_input(struct ifnet *ifp, struct mbu
 	} else {
 		switch (ifp->if_type) {
 		case IFT_ETHER:
+		case IFT_L2VLAN:
 			if (m->m_len < sizeof(*evl) &&
 			    (m = m_pullup(m, sizeof(*evl))) == NULL) {
 				if_printf(ifp, "cannot pullup VLAN header\n");
@@ -641,7 +643,8 @@ vlan_config(struct ifvlan *ifv, struct i
 
 	VLAN_LOCK_ASSERT();
 
-	if (p->if_data.ifi_type != IFT_ETHER)
+	if (p->if_data.ifi_type != IFT_ETHER &&
+	    p->if_data.ifi_type != IFT_L2VLAN)
 		return (EPROTONOSUPPORT);
 	if (ifv->ifv_p)
 		return (EBUSY);

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20041220/fcf79533/attachment.bin


More information about the freebsd-net mailing list