Skip to content

Commit b389983

Browse files
idoschdavem330
authored andcommitted
bpf: lwtunnel: Unmask upper DSCP bits in bpf_lwt_xmit_reroute()
Unmask the upper DSCP bits when calling ip_route_output_key() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25376a8 commit b389983

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/lwt_bpf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <net/gre.h>
1313
#include <net/ip6_route.h>
1414
#include <net/ipv6_stubs.h>
15+
#include <net/inet_dscp.h>
1516

1617
struct bpf_lwt_prog {
1718
struct bpf_prog *prog;
@@ -205,7 +206,7 @@ static int bpf_lwt_xmit_reroute(struct sk_buff *skb)
205206
fl4.flowi4_oif = oif;
206207
fl4.flowi4_mark = skb->mark;
207208
fl4.flowi4_uid = sock_net_uid(net, sk);
208-
fl4.flowi4_tos = RT_TOS(iph->tos);
209+
fl4.flowi4_tos = iph->tos & INET_DSCP_MASK;
209210
fl4.flowi4_flags = FLOWI_FLAG_ANYSRC;
210211
fl4.flowi4_proto = iph->protocol;
211212
fl4.daddr = iph->daddr;

0 commit comments

Comments
 (0)