Skip to content

Commit 4961d07

Browse files
qmonnetborkmann
authored andcommitted
bpf: Clear up confusion in bpf_skb_adjust_room()'s documentation
Adding or removing room space _below_ layers 2 or 3, as the description mentions, is ambiguous. This was written with a mental image of the packet with layer 2 at the top, layer 3 under it, and so on. But it has led users to believe that it was on lower layers (before the beginning of the L2 and L3 headers respectively). Let's make it more explicit, and specify between which layers the room space is adjusted. Reported-by: Rumen Telbizov <rumen.telbizov@menlosecurity.com> Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220812153727.224500-3-quentin@isovalent.com
1 parent 54c9397 commit 4961d07

File tree

2 files changed

+8
-4
lines changed
  • include/uapi/linux
  • tools/include/uapi/linux

2 files changed

+8
-4
lines changed

include/uapi/linux/bpf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,10 +2573,12 @@ union bpf_attr {
25732573
* There are two supported modes at this time:
25742574
*
25752575
* * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
2576-
* (room space is added or removed below the layer 2 header).
2576+
* (room space is added or removed between the layer 2 and
2577+
* layer 3 headers).
25772578
*
25782579
* * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
2579-
* (room space is added or removed below the layer 3 header).
2580+
* (room space is added or removed between the layer 3 and
2581+
* layer 4 headers).
25802582
*
25812583
* The following flags are supported at this time:
25822584
*

tools/include/uapi/linux/bpf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,10 +2573,12 @@ union bpf_attr {
25732573
* There are two supported modes at this time:
25742574
*
25752575
* * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
2576-
* (room space is added or removed below the layer 2 header).
2576+
* (room space is added or removed between the layer 2 and
2577+
* layer 3 headers).
25772578
*
25782579
* * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
2579-
* (room space is added or removed below the layer 3 header).
2580+
* (room space is added or removed between the layer 3 and
2581+
* layer 4 headers).
25802582
*
25812583
* The following flags are supported at this time:
25822584
*

0 commit comments

Comments
 (0)