summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2016-06-11 20:08:19 +0200
committerDavid S. Miller <davem@davemloft.net>2016-06-11 15:33:26 -0700
commit38b7097b55b6cf30adc5ac07cb1055683224393e (patch)
tree354f839048b45dcfa415469431fa4640fd6f2652 /net/ipv6/udp.c
parente69f73bfecb0178ae6bd20eb778211739cd71fab (diff)
downloadblackbird-op-linux-38b7097b55b6cf30adc5ac07cb1055683224393e.tar.gz
blackbird-op-linux-38b7097b55b6cf30adc5ac07cb1055683224393e.zip
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/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f421c9f23c5b..4bb5c13777f1 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1246,6 +1246,11 @@ do_udp_sendmsg:
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
+ if (ipc6.tclass < 0)
+ ipc6.tclass = np->tclass;
+
+ fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
+
dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p);
if (IS_ERR(dst)) {
err = PTR_ERR(dst);
@@ -1256,9 +1261,6 @@ do_udp_sendmsg:
if (ipc6.hlimit < 0)
ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
- if (ipc6.tclass < 0)
- ipc6.tclass = np->tclass;
-
if (msg->msg_flags&MSG_CONFIRM)
goto do_confirm;
back_from_confirm:
OpenPOWER on IntegriCloud