commit 97a314a172d9840f9c72ef12d7456b60891b4290 Author: Patrick McHardy 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 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); }