diff options
author | Atzm Watanabe <atzm@stratosphere.co.jp> | 2013-12-17 22:53:36 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-18 00:36:16 -0500 |
commit | e4d26f4b080f55e9577b45e6b51a04971eb459e9 (patch) | |
tree | e7caf4bc1439ce04ac392d94dd71c13aaf90f0e4 /net/packet/af_packet.c | |
parent | 51846355bc239b7d229ed7a1ea7b0333cbd23f01 (diff) |
packet: fill the gap of TPACKET_ALIGNMENT with zeros
struct tpacket{2,3}_hdr is aligned to a multiple of TPACKET_ALIGNMENT.
Explicitly defining and zeroing the gap of this makes additional changes
easier.
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 4fd52181b6c..f281999ba92 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1929,7 +1929,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, } else { h.h2->tp_vlan_tci = 0; } - h.h2->tp_padding = 0; + memset(h.h2->tp_padding, 0, sizeof(h.h2->tp_padding)); hdrlen = sizeof(*h.h2); break; case TPACKET_V3: @@ -1943,6 +1943,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, h.h3->tp_net = netoff; h.h3->tp_sec = ts.tv_sec; h.h3->tp_nsec = ts.tv_nsec; + memset(h.h3->tp_padding, 0, sizeof(h.h3->tp_padding)); hdrlen = sizeof(*h.h3); break; default: |