bpf: Change bpf_fib_lookup to return -EAFNOSUPPORT for unsupported address families
Subsystems (4)
PATCH 1/1 bpf: Change bpf_fib_lookup to return -EAFNOSUPPORT for unsupported address families
From: David Ahern <[email protected]>
Update bpf_fib_lookup to return -EAFNOSUPPORT for unsupported address families. Allows userspace to probe for support as more are added (e.g., AF_MPLS).
Signed-off-by David Ahern <[email protected]>
--- net/core/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/filter.c +2 -2
@@ -4285,7 +4285,7 @@ BPF_CALL_4(bpf_xdp_fib_lookup, struct xdp_buff *, ctx, flags, true);#endif } -return 0 ; +return -EAFNOSUPPORT ; }static const struct bpf_func_proto bpf_xdp_fib_lookup_proto = {
@@ -4302,7 +4302,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, struct bpf_fib_lookup *, params, int, plen, u32, flags) { struct net *net = dev_net(skb->dev); -int index =0 ; +int index = -EAFNOSUPPORT ;if (plen <sizeof (*params))return -EINVAL ;
Signature · 1 line
2.11.0
Alexei Starovoitov
AppliedQuoted 7 lines · On Wed, May 30, 2018 at 12:24:17PM -0700, [email protected] wrote:
From: David Ahern <[email protected]>
Update
bpf_fib_lookupto return-EAFNOSUPPORTfor unsupported address families. Allows userspace to probe for support as more are added (e.g.,AF_MPLS).Signed-off-by David Ahern <[email protected]>
Applied, Thanks