diff options
| author | Martin KaFai Lau <[email protected]> | 2020-08-20 19:00:14 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-08-24 21:34:59 +0000 |
| commit | 70a217f1976f75a6cfe8223e5669ad7b405daaad (patch) | |
| tree | 56f92c968ad9e132de0c19761b648cdc3d38c518 /net/ipv4/tcp_output.c | |
| parent | libbpf: Normalize and improve logging across few functions (diff) | |
| download | kernel-70a217f1976f75a6cfe8223e5669ad7b405daaad.tar.gz kernel-70a217f1976f75a6cfe8223e5669ad7b405daaad.zip | |
tcp: Use a struct to represent a saved_syn
The TCP_SAVE_SYN has both the network header and tcp header.
The total length of the saved syn packet is currently stored in
the first 4 bytes (u32) of an array and the actual packet data is
stored after that.
A later patch will add a bpf helper that allows to get the tcp header
alone from the saved syn without the network header. It will be more
convenient to have a direct offset to a specific header instead of
re-parsing it. This requires to separately store the network hdrlen.
The total header length (i.e. network + tcp) is still needed for the
current usage in getsockopt. Although this total length can be obtained
by looking into the tcphdr and then get the (th->doff << 2), this patch
chooses to directly store the tcp hdrlen in the second four bytes of
this newly created "struct saved_syn". By using a new struct, it can
give a readable name to each individual header length.
Signed-off-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'net/ipv4/tcp_output.c')
0 files changed, 0 insertions, 0 deletions
