From owner-freebsd-net@FreeBSD.ORG Thu Oct 25 21:41:38 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6128716A419; Thu, 25 Oct 2007 21:41:38 +0000 (UTC) (envelope-from jon.otterholm@ide.resurscentrum.se) Received: from mail1.cil.se (mail1.cil.se [217.197.56.125]) by mx1.freebsd.org (Postfix) with ESMTP id D9B5113C48A; Thu, 25 Oct 2007 21:41:37 +0000 (UTC) (envelope-from jon.otterholm@ide.resurscentrum.se) Received: from [192.168.98.91] ([192.168.44.2]) by mail1.cil.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 25 Oct 2007 23:41:36 +0200 Message-ID: <47210D92.1050403@ide.resurscentrum.se> Date: Thu, 25 Oct 2007 23:41:38 +0200 From: Jon Otterholm User-Agent: Thunderbird 2.0.0.6 (X11/20070804) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: multipart/mixed; boundary="------------000608080205010905040602" X-OriginalArrivalTime: 25 Oct 2007 21:41:36.0271 (UTC) FILETIME=[D16101F0:01C8174F] Cc: Andrew Thompson Subject: QinQ X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2007 21:41:38 -0000 This is a multi-part message in MIME format. --------------000608080205010905040602 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi. I was wondering about the possibility of adding support for QinQ ("Double tagged frames" / "Nested vlans"). Attached is a patch against -STABLE to add this support. I have not tested this but was told it should work. Would it be possible to get this into CURRENT? //Jon --------------000608080205010905040602 Content-Type: text/plain; name="if_vlan.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="if_vlan.c.patch" --- if_vlan.c.orig 2006-10-17 14:24:18.000000000 +0700 +++ if_vlan.c 2007-09-14 14:00:44.000000000 +0700 @@ -327,7 +327,8 @@ /* Check for . 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; @@ -672,6 +673,7 @@ mtag = NULL; 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"); @@ -748,8 +750,9 @@ VLAN_LOCK_ASSERT(); - if (p->if_type != IFT_ETHER) - return (EPROTONOSUPPORT); + if ((p->if_data.ifi_type != IFT_ETHER) && + (p->if_data.ifi_type != IFT_L2VLAN)) + return (EPROTONOSUPPORT); if ((p->if_flags & VLAN_IFFLAGS) != VLAN_IFFLAGS) return (EPROTONOSUPPORT); if (ifv->ifv_p) --------------000608080205010905040602--