diff options
author | Patrick McHardy <kaber@trash.net> | 2008-07-14 22:50:39 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-14 22:50:39 -0700 |
commit | 393e52e33c6c26ec7db290dab803bac1bed962d4 (patch) | |
tree | 54e93a35c98b994556724ad96a90871bfc38b3b4 /net/packet | |
parent | bbd6ef87c544d88c30e4b762b1b61ef267a7d279 (diff) | |
download | kernel_goldelico_gta04-393e52e33c6c26ec7db290dab803bac1bed962d4.zip kernel_goldelico_gta04-393e52e33c6c26ec7db290dab803bac1bed962d4.tar.gz kernel_goldelico_gta04-393e52e33c6c26ec7db290dab803bac1bed962d4.tar.bz2 |
packet: deliver VLAN TCI to userspace
Store the VLAN tag in the auxillary data/tpacket2_hdr so userspace can
properly deal with hardware VLAN tagging/stripping.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 4f05977..db792e0 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -702,6 +702,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe getnstimeofday(&ts); h.h2->tp_sec = ts.tv_sec; h.h2->tp_nsec = ts.tv_nsec; + h.h2->tp_vlan_tci = skb->vlan_tci; hdrlen = sizeof(*h.h2); break; default: @@ -1172,6 +1173,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); } |