Skip to content
Commit 5920cd3a authored by Paul Chavent's avatar Paul Chavent Committed by David S. Miller
Browse files

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: default avatarPaul Chavent <paul.chavent@onera.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7da716ae
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment