mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-04 23:59:07 +08:00
bpf: Add ipip6 and ip6ip decap support for bpf_skb_adjust_room()
Add ipip6 and ip6ip decap support for bpf_skb_adjust_room().
Main use case is for using cls_bpf on ingress hook to decapsulate
IPv4 over IPv6 and IPv6 over IPv4 tunnel packets.
Add two new flags BPF_F_ADJ_ROOM_DECAP_L3_IPV{4,6} to indicate the
new IP header version after decapsulating the outer IP header.
Suggested-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/b268ec7f0ff9431f4f43b1b40ab856ebb28cb4e1.1673574419.git.william.xuanziyang@huawei.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
committed by
Andrii Nakryiko
parent
49e950dcfa
commit
ed09f7e65b
@@ -2647,6 +2647,11 @@ union bpf_attr {
|
|||||||
* Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
|
* Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
|
||||||
* L2 type as Ethernet.
|
* L2 type as Ethernet.
|
||||||
*
|
*
|
||||||
|
* * **BPF_F_ADJ_ROOM_DECAP_L3_IPV4**,
|
||||||
|
* **BPF_F_ADJ_ROOM_DECAP_L3_IPV6**:
|
||||||
|
* Indicate the new IP header version after decapsulating the outer
|
||||||
|
* IP header. Used when the inner and outer IP versions are different.
|
||||||
|
*
|
||||||
* A call to this helper is susceptible to change the underlying
|
* A call to this helper is susceptible to change the underlying
|
||||||
* packet buffer. Therefore, at load time, all checks on pointers
|
* packet buffer. Therefore, at load time, all checks on pointers
|
||||||
* previously done by the verifier are invalidated and must be
|
* previously done by the verifier are invalidated and must be
|
||||||
@@ -5807,6 +5812,8 @@ enum {
|
|||||||
BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
|
BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
|
||||||
BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
|
BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
|
||||||
BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
|
BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
|
||||||
|
BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = (1ULL << 7),
|
||||||
|
BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = (1ULL << 8),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
Reference in New Issue
Block a user