Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103530
b: refs/heads/master
c: 393e52e
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 15, 2008
1 parent ced32b7 commit 0a725d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbd6ef87c544d88c30e4b762b1b61ef267a7d279
refs/heads/master: 393e52e33c6c26ec7db290dab803bac1bed962d4
2 changes: 2 additions & 0 deletions trunk/include/linux/if_packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct tpacket_auxdata
__u32 tp_snaplen;
__u16 tp_mac;
__u16 tp_net;
__u16 tp_vlan_tci;
};

struct tpacket_hdr
Expand Down Expand Up @@ -90,6 +91,7 @@ struct tpacket2_hdr
__u16 tp_net;
__u32 tp_sec;
__u32 tp_nsec;
__u16 tp_vlan_tci;
};

#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0a725d9

Please sign in to comment.