From owner-freebsd-net@FreeBSD.ORG Thu Dec 2 20:33:15 2010 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 17D84106566B for ; Thu, 2 Dec 2010 20:33:15 +0000 (UTC) (envelope-from Rozhuk_I@mail.ru) Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.176.129]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB978FC1A for ; Thu, 2 Dec 2010 20:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Reply-To; bh=9MuNMQEEykW/rQQIGOb3d+YsPnWLU5EcwXtGXrXDxyE=; b=So3fEeexQj8jnJosPNlDNf5vcCWZl/+R5HMq6PvBf+X8KehzUuw0mvZKiXisSxkLATrA7TaRzeaw/LC/3GWvF6MyInMXjcDz/DC6skDYbRcj9AGECqnKZlLLqdMW/PgO; Received: from [92.124.46.175] (port=1 helo=smtp1.mail.ru) by smtp1.mail.ru with asmtp id 1POFq4-00049H-00 for freebsd-net@freebsd.org; Thu, 02 Dec 2010 23:33:12 +0300 From: "Rozhuk Ivan" To: Date: Fri, 3 Dec 2010 04:33:10 +0800 Message-ID: <000001cb9260$23aeb900$6b0c2b00$@ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01CB92A3.31D1F900" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuSYCKL7alibDEUS/Cf/u0nsLKDlA== Content-Language: ru X-Mras: Ok Subject: kern/152141: [vlan] encapsulate vlan in ng_ether before output to if X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk_I@mail.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 20:33:15 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0001_01CB92A3.31D1F900 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Hi! This is a patch for ng_ether_rcv_lower function in ng_ether.c to = encapsulate vlan before send to net. =A0 -- Rozhuk Ivan =A0=20 ------=_NextPart_000_0001_01CB92A3.31D1F900 Content-Type: application/octet-stream; name="ng_ether.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ng_ether.patch" --- /usr/src/sys/netgraph/ng_ether.c 2010-01-19 04:34:00.000000000 +0800=0A= +++ /usr/src/sys/netgraph/ng_ether.new 2010-11-20 18:26:55.000000000 = +0800=0A= @@ -652,6 +652,20 @@=0A= ETHER_ADDR_LEN);=0A= }=0A= =0A= + /*=0A= + * If underlying interface can not do VLAN tag insertion itself=0A= + * then attach a packet tag that holds it.=0A= + */=0A= + if ((m->m_flags & M_VLANTAG) &&=0A= + (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) =3D=3D 0) {=0A= + m =3D ether_vlanencap(m, m->m_pkthdr.ether_vtag);=0A= + if (m =3D=3D NULL) {=0A= + ifp->if_oerrors++;=0A= + return (ENOBUFS);=0A= + }=0A= + m->m_flags &=3D ~M_VLANTAG;=0A= + }=0A= +=0A= /* Send it on its way */=0A= return ether_output_frame(ifp, m);=0A= }=0A= ------=_NextPart_000_0001_01CB92A3.31D1F900--