summaryrefslogtreecommitdiffstats
path: root/net/packet/internal.h
diff options
context:
space:
mode:
authorPaul Chavent <Paul.Chavent@onera.fr>2012-11-06 23:10:47 +0000
committerDavid S. Miller <davem@davemloft.net>2012-11-07 18:54:30 -0500
commit5920cd3a41f1aefc30e9ce86384fc2fe9f5fe0c0 (patch)
treececc965a19e1ffe6957d8dcf2e55566562f93e0c /net/packet/internal.h
parent7da716aee2532399e213a14f656d304098f67a11 (diff)
downloadlinux-0-day-5920cd3a41f1aefc30e9ce86384fc2fe9f5fe0c0.tar.gz
linux-0-day-5920cd3a41f1aefc30e9ce86384fc2fe9f5fe0c0.tar.xz
packet: tx_ring: allow the user to choose tx data offset
The tx data offset of packet mmap tx ring used to be : (TPACKET2_HDRLEN - sizeof(struct sockaddr_ll)) The problem is that, with SOCK_RAW socket, the payload (14 bytes after the beginning of the user data) is misaligned. This patch allows to let the user gives an offset for it's tx data if he desires. Set sock option PACKET_TX_HAS_OFF to 1, then specify in each frame of your tx ring tp_net for SOCK_DGRAM, or tp_mac for SOCK_RAW. Signed-off-by: Paul Chavent <paul.chavent@onera.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r--net/packet/internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h
index 44945f6b7252c..e84cab8cb7a99 100644
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
@@ -109,6 +109,7 @@ struct packet_sock {
unsigned int tp_hdrlen;
unsigned int tp_reserve;
unsigned int tp_loss:1;
+ unsigned int tp_tx_has_off:1;
unsigned int tp_tstamp;
struct packet_type prot_hook ____cacheline_aligned_in_smp;
};