aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2016-06-11 14:08:19 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-11 18:33:26 -0400
commit38b7097b55b6cf30adc5ac07cb1055683224393e (patch)
tree354f839048b45dcfa415469431fa4640fd6f2652 /net/l2tp
parente69f73bfecb0178ae6bd20eb778211739cd71fab (diff)
ipv6: use TOS marks from sockets for routing decision
In IPv6 the ToS values are part of the flowlabel in flowi6 and get extracted during fib rule lookup, but we forgot to correctly initialize the flowlabel before the routing lookup. Reported-by: <liam.mcbirnie@boeing.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r--net/l2tp/l2tp_ip6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index 6c54e03fe9c1..ea2ae6664cc8 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -611,6 +611,11 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
611 611
612 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); 612 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
613 613
614 if (ipc6.tclass < 0)
615 ipc6.tclass = np->tclass;
616
617 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
618
614 dst = ip6_dst_lookup_flow(sk, &fl6, final_p); 619 dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
615 if (IS_ERR(dst)) { 620 if (IS_ERR(dst)) {
616 err = PTR_ERR(dst); 621 err = PTR_ERR(dst);
@@ -620,9 +625,6 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
620 if (ipc6.hlimit < 0) 625 if (ipc6.hlimit < 0)
621 ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst); 626 ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
622 627
623 if (ipc6.tclass < 0)
624 ipc6.tclass = np->tclass;
625
626 if (ipc6.dontfrag < 0) 628 if (ipc6.dontfrag < 0)
627 ipc6.dontfrag = np->dontfrag; 629 ipc6.dontfrag = np->dontfrag;
628 630