Follow-up to address David's feedback that we should better describe internals of the bpf_redirect_neigh() helper.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -3679,10 +3679,14 @@ union bpf_attr { · 3678 unmodified lines | |||
| 3679 | * Redirect the packet to another net device of index *ifindex* | 3679 | * Redirect the packet to another net device of index *ifindex* |
| 3680 | * and fill in L2 addresses from neighboring subsystem. This helper | 3680 | * and fill in L2 addresses from neighboring subsystem. This helper |
| 3681 | * is somewhat similar to **bpf_redirect**\ (), except that it | 3681 | * is somewhat similar to **bpf_redirect**\ (), except that it |
| 3682 | * fills in e.g. MAC addresses based on the L3 information from | 3682 | * populates L2 addresses as well, meaning, internally, the helper |
| 3683 | * the packet. This helper is supported for IPv4 and IPv6 protocols. | 3683 | * performs a FIB lookup based on the skb's networking header to |
| 3684 | * get the address of the next hop and then relies on the neighbor | ||
| 3685 | * lookup for the L2 address of the nexthop. | ||
| 3686 | * | ||
| 3684 | * The *flags* argument is reserved and must be 0. The helper is | 3687 | * The *flags* argument is reserved and must be 0. The helper is |
| 3685 | * currently only supported for tc BPF program types. | 3688 | * currently only supported for tc BPF program types, and enabled |
| 3689 | * for IPv4 and IPv6 protocols. | ||
| 3686 | * Return | 3690 | * Return |
| 3687 | * The helper returns **TC_ACT_REDIRECT** on success or | 3691 | * The helper returns **TC_ACT_REDIRECT** on success or |
| 3688 | * **TC_ACT_SHOT** on error. | 3692 | * **TC_ACT_SHOT** on error. |