netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH 03/04]: packet: Store VLAN tag in auxillary data
Date: Tue, 08 Jul 2008 12:21:13 +0200	[thread overview]
Message-ID: <48733F99.5010901@trash.net> (raw)
In-Reply-To: <48733E77.20808@trash.net>

[-- Attachment #1: Type: text/plain, Size: 25 bytes --]

Missing patch attached.


[-- Attachment #2: 03.diff --]
[-- Type: text/x-diff, Size: 1096 bytes --]

commit 97a314a172d9840f9c72ef12d7456b60891b4290
Author: Patrick McHardy <kaber@trash.net>
Date:   Tue Jul 8 11:38:43 2008 +0200

    packet: Store VLAN tag in auxillary data
    
    Store the VLAN tag in the auxillary data so userspace can properly deal with
    hardware VLAN tagging/stripping.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index ad09609..4e1fc2a 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -57,6 +57,7 @@ struct tpacket_auxdata
 	__u32		tp_snaplen;
 	__u16		tp_mac;
 	__u16		tp_net;
+	__u16		tp_vlan_tci;
 };
 
 struct tpacket_hdr
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index beca640..951e62e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1107,6 +1107,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
 		aux.tp_snaplen = skb->len;
 		aux.tp_mac = 0;
 		aux.tp_net = skb_network_offset(skb);
+		aux.tp_vlan_tci = skb->vlan_tci;
 
 		put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux);
 	}

  reply	other threads:[~2008-07-08 10:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08 10:14 [RFC PATCH 00/04]: VLAN vs. packet socket inconsistencies Patrick McHardy
2008-07-08 10:15 ` [RFC PATCH 01/04]: vlan: Don't store VLAN tag in cb Patrick McHardy
2008-07-08 10:16 ` [RFC PATCH 02/04]: vlan: deliver packets received with VLAN acceleration to network taps Patrick McHardy
2008-07-08 10:16 ` [RFC PATCH 03/04]: packet: Store VLAN tag in auxillary data Patrick McHardy
2008-07-08 10:21   ` Patrick McHardy [this message]
2008-07-08 10:17 ` [RFC PATCH 04/04]: libpcap: reconstruct VLAN header from auxdata Patrick McHardy
2008-07-08 22:12 ` [RFC PATCH 00/04]: VLAN vs. packet socket inconsistencies David Miller
2008-07-08 22:30   ` Patrick McHardy
2008-07-08 22:35     ` David Miller
2008-07-08 22:38       ` David Miller
2008-07-08 22:48         ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48733F99.5010901@trash.net \
    --to=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).