Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253055
b: refs/heads/master
c: a3bcc23
h: refs/heads/master
i:
  253053: 9aac46b
  253051: d29272a
  253047: 2ceb762
  253039: 2b9ff66
  253023: e68c122
  252991: 11454ba
  252927: 107401c
v: v3
  • Loading branch information
Ben Greear authored and David S. Miller committed Jun 2, 2011
1 parent 17ab01c commit 2a87299
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41be5a4a3668810bf3687a76c2b017bd437039e0
refs/heads/master: a3bcc23e890a6d49d6763d9eb073d711de2e0469
1 change: 1 addition & 0 deletions trunk/include/linux/if_packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct tpacket_auxdata {
#define TP_STATUS_COPY 0x2
#define TP_STATUS_LOSING 0x4
#define TP_STATUS_CSUMNOTREADY 0x8
#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */

/* Tx ring - header status */
#define TP_STATUS_AVAILABLE 0x0
Expand Down
15 changes: 12 additions & 3 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,12 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
getnstimeofday(&ts);
h.h2->tp_sec = ts.tv_sec;
h.h2->tp_nsec = ts.tv_nsec;
h.h2->tp_vlan_tci = vlan_tx_tag_get(skb);
if (vlan_tx_tag_present(skb)) {
h.h2->tp_vlan_tci = vlan_tx_tag_get(skb);
status |= TP_STATUS_VLAN_VALID;
} else {
h.h2->tp_vlan_tci = 0;
}
hdrlen = sizeof(*h.h2);
break;
default:
Expand Down Expand Up @@ -1725,8 +1730,12 @@ 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 = vlan_tx_tag_get(skb);

if (vlan_tx_tag_present(skb)) {
aux.tp_vlan_tci = vlan_tx_tag_get(skb);
aux.tp_status |= TP_STATUS_VLAN_VALID;
} else {
aux.tp_vlan_tci = 0;
}
put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux);
}

Expand Down

0 comments on commit 2a87299

Please sign in to comment.