Skip to content

Commit 8b6d13c

Browse files
idoschdavem330
authored andcommitted
sctp: Unmask upper DSCP bits in sctp_v4_get_dst()
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 the 'tos' variable holds the full DS field. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Reviewed-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2c60fc9 commit 8b6d13c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sctp/protocol.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <net/inet_common.h>
4545
#include <net/inet_ecn.h>
4646
#include <net/udp_tunnel.h>
47+
#include <net/inet_dscp.h>
4748

4849
#define MAX_SCTP_PORT_HASH_ENTRIES (64 * 1024)
4950

@@ -435,7 +436,7 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
435436
fl4->fl4_dport = daddr->v4.sin_port;
436437
fl4->flowi4_proto = IPPROTO_SCTP;
437438
if (asoc) {
438-
fl4->flowi4_tos = RT_TOS(tos);
439+
fl4->flowi4_tos = tos & INET_DSCP_MASK;
439440
fl4->flowi4_scope = ip_sock_rt_scope(asoc->base.sk);
440441
fl4->flowi4_oif = asoc->base.sk->sk_bound_dev_if;
441442
fl4->fl4_sport = htons(asoc->base.bind_addr.port);

0 commit comments

Comments
 (0)