aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/if_packet.h2
-rw-r--r--net/packet/af_packet.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index d4d3c82448f5..a630295b255f 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -59,6 +59,7 @@ struct tpacket_auxdata
59 __u32 tp_snaplen; 59 __u32 tp_snaplen;
60 __u16 tp_mac; 60 __u16 tp_mac;
61 __u16 tp_net; 61 __u16 tp_net;
62 __u16 tp_vlan_tci;
62}; 63};
63 64
64struct tpacket_hdr 65struct tpacket_hdr
@@ -90,6 +91,7 @@ struct tpacket2_hdr
90 __u16 tp_net; 91 __u16 tp_net;
91 __u32 tp_sec; 92 __u32 tp_sec;
92 __u32 tp_nsec; 93 __u32 tp_nsec;
94 __u16 tp_vlan_tci;
93}; 95};
94 96
95#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 97#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 4f059775d48f..db792e02a37f 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
702 getnstimeofday(&ts); 702 getnstimeofday(&ts);
703 h.h2->tp_sec = ts.tv_sec; 703 h.h2->tp_sec = ts.tv_sec;
704 h.h2->tp_nsec = ts.tv_nsec; 704 h.h2->tp_nsec = ts.tv_nsec;
705 h.h2->tp_vlan_tci = skb->vlan_tci;
705 hdrlen = sizeof(*h.h2); 706 hdrlen = sizeof(*h.h2);
706 break; 707 break;
707 default: 708 default:
@@ -1172,6 +1173,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
1172 aux.tp_snaplen = skb->len; 1173 aux.tp_snaplen = skb->len;
1173 aux.tp_mac = 0; 1174 aux.tp_mac = 0;
1174 aux.tp_net = skb_network_offset(skb); 1175 aux.tp_net = skb_network_offset(skb);
1176 aux.tp_vlan_tci = skb->vlan_tci;
1175 1177
1176 put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux); 1178 put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux);
1177 } 1179 }