Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Sep 2011 10:35:20 +0700
From:      "Ivan Alexandrovich" <ivsan@ngs.ru>
To:        freebsd-net@freebsd.org
Cc:        Kurt Jaeger <lists@opsec.eu>
Subject:   Re: Subject:   ethernet Q-in-Q ?
Message-ID:  <web-9695190@mx16.intranet.ru>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi

Here's ugly patch against in 8.2-RELEASE (see attachment) that
makes vlan nesting possible.

  # ifconfig em0.15 create
  # ifconfig em0.15.18 create

Don't know about possible side effects though.
I suppose it doesn't play well wth bridges etc.

With ng_vlan nesting is also possible, but since 8.0
I had to comment out this node name check in ng_ether.c:

      if ((node = ng_name2noderef(NULL, ifp->if_xname)) != NULL) {
              NG_NODE_UNREF(node);
              return;

Best regards,
Ivan

Tue, 30 Aug 2011 15:01:18 +0200 Kurt Jaeger <lists@opsec.eu> wrote:
> Hi!
>
> What about 802.1q VLANs encapsulated in another 802.1q VLAN ?
>
> On FreeBSD 8.1 or 9.0-BETA1:
>
>   ifconfig vlan123 create
>   ifconfig vlan123 vlandev em0 vlan 123
>   ifconfig vlan400 create
>   ifconfig vlan400 vlandev vlan123 vlan 400
> ------
> ifconfig: SIOCSETVLAN: Protocol not supported
> ------
>
> Any ideas ?
>
> --
> pi@opsec.eu            +49 171 3101372                         9 years to go !

[-- Attachment #2 --]
#src/sys/net/if_vlan.c
--- if_vlan.c.orig      2010-12-21 23:09:25.000000000 +0600
+++ if_vlan.c   2011-05-31 23:14:55.000000000 +0700
@@ -665,7 +665,7 @@
        /* Check for <etherif>.<vlan> style interface names. */
        IFNET_RLOCK_NOSLEEP();
        TAILQ_FOREACH(ifp, &V_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;
@@ -1045,7 +1045,7 @@
        /* VID numbers 0x0 and 0xFFF are reserved */
        if (tag == 0 || tag == 0xFFF)
                return (EINVAL);
-       if (p->if_type != IFT_ETHER)
+       if (p->if_type != IFT_ETHER && p->if_type != IFT_L2VLAN)
                return (EPROTONOSUPPORT);
        if ((p->if_flags & VLAN_IFFLAGS) != VLAN_IFFLAGS)
                return (EPROTONOSUPPORT);


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?web-9695190>