diff options
| author | David Ahern <dsahern@gmail.com> | 2018-06-03 11:15:19 -0400 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2018-06-03 21:29:07 -0400 |
| commit | bd3a08aaa9a383ffbbd5b788b797ae6e64eaa7a1 (patch) | |
| tree | 08299ba501c806105ed4568f4e3094b5040d6d3e | |
| parent | 432bdb581e410ad3cea8f04e9323397f17501e3e (diff) | |
bpf: flowlabel in bpf_fib_lookup should be flowinfo
As Michal noted the flow struct takes both the flow label and priority.
Update the bpf_fib_lookup API to note that it is flowinfo and not just
the flow label.
Cc: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
| -rw-r--r-- | include/uapi/linux/bpf.h | 2 | ||||
| -rw-r--r-- | net/core/filter.c | 2 | ||||
| -rw-r--r-- | samples/bpf/xdp_fwd_kern.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 18712b0dbfe7..eeb6237be5c2 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -2629,7 +2629,7 @@ struct bpf_fib_lookup { | |||
| 2629 | union { | 2629 | union { |
| 2630 | /* inputs to lookup */ | 2630 | /* inputs to lookup */ |
| 2631 | __u8 tos; /* AF_INET */ | 2631 | __u8 tos; /* AF_INET */ |
| 2632 | __be32 flowlabel; /* AF_INET6 */ | 2632 | __be32 flowinfo; /* AF_INET6, flow_label + priority */ |
| 2633 | 2633 | ||
| 2634 | /* output: metric of fib result (IPv4/IPv6 only) */ | 2634 | /* output: metric of fib result (IPv4/IPv6 only) */ |
| 2635 | __u32 rt_metric; | 2635 | __u32 rt_metric; |
diff --git a/net/core/filter.c b/net/core/filter.c index a72ea9f61010..3d9ba7e5965a 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
| @@ -4221,7 +4221,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4221 | fl6.flowi6_oif = 0; | 4221 | fl6.flowi6_oif = 0; |
| 4222 | strict = RT6_LOOKUP_F_HAS_SADDR; | 4222 | strict = RT6_LOOKUP_F_HAS_SADDR; |
| 4223 | } | 4223 | } |
| 4224 | fl6.flowlabel = params->flowlabel; | 4224 | fl6.flowlabel = params->flowinfo; |
| 4225 | fl6.flowi6_scope = 0; | 4225 | fl6.flowi6_scope = 0; |
| 4226 | fl6.flowi6_flags = 0; | 4226 | fl6.flowi6_flags = 0; |
| 4227 | fl6.mp_hash = 0; | 4227 | fl6.mp_hash = 0; |
diff --git a/samples/bpf/xdp_fwd_kern.c b/samples/bpf/xdp_fwd_kern.c index 4a6be0f87505..6673cdb9f55c 100644 --- a/samples/bpf/xdp_fwd_kern.c +++ b/samples/bpf/xdp_fwd_kern.c | |||
| @@ -88,7 +88,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) | |||
| 88 | return XDP_PASS; | 88 | return XDP_PASS; |
| 89 | 89 | ||
| 90 | fib_params.family = AF_INET6; | 90 | fib_params.family = AF_INET6; |
| 91 | fib_params.flowlabel = *(__be32 *)ip6h & IPV6_FLOWINFO_MASK; | 91 | fib_params.flowinfo = *(__be32 *)ip6h & IPV6_FLOWINFO_MASK; |
| 92 | fib_params.l4_protocol = ip6h->nexthdr; | 92 | fib_params.l4_protocol = ip6h->nexthdr; |
| 93 | fib_params.sport = 0; | 93 | fib_params.sport = 0; |
| 94 | fib_params.dport = 0; | 94 | fib_params.dport = 0; |
