Skip to content

Commit 2c60fc9

Browse files
idoschdavem330
authored andcommitted
ipv4: udp_tunnel: Unmask upper DSCP bits in udp_tunnel_dst_lookup()
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. Note that callers of udp_tunnel_dst_lookup() pass the entire DS field in the 'tos' argument. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 345663e commit 2c60fc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/udp_tunnel_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <net/dst_metadata.h>
77
#include <net/udp.h>
88
#include <net/udp_tunnel.h>
9+
#include <net/inet_dscp.h>
910

1011
int udp_sock_create4(struct net *net, struct udp_port_cfg *cfg,
1112
struct socket **sockp)
@@ -232,7 +233,7 @@ struct rtable *udp_tunnel_dst_lookup(struct sk_buff *skb,
232233
fl4.saddr = key->u.ipv4.src;
233234
fl4.fl4_dport = dport;
234235
fl4.fl4_sport = sport;
235-
fl4.flowi4_tos = RT_TOS(tos);
236+
fl4.flowi4_tos = tos & INET_DSCP_MASK;
236237
fl4.flowi4_flags = key->flow_flags;
237238

238239
rt = ip_route_output_key(net, &fl4);

0 commit comments

Comments
 (0)