diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2016-06-11 20:08:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-11 15:33:26 -0700 |
commit | 38b7097b55b6cf30adc5ac07cb1055683224393e (patch) | |
tree | 354f839048b45dcfa415469431fa4640fd6f2652 /net/ipv6/ping.c | |
parent | e69f73bfecb0178ae6bd20eb778211739cd71fab (diff) | |
download | linux-stable-38b7097b55b6cf30adc5ac07cb1055683224393e.tar.gz linux-stable-38b7097b55b6cf30adc5ac07cb1055683224393e.tar.bz2 linux-stable-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/ping.c')
-rw-r--r-- | net/ipv6/ping.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index 3ee3e444a66b..fed40d1ec29b 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c @@ -116,6 +116,9 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) else if (!fl6.flowi6_oif) fl6.flowi6_oif = np->ucast_oif; + ipc6.tclass = np->tclass; + fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); + dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr); if (IS_ERR(dst)) return PTR_ERR(dst); @@ -140,7 +143,6 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) pfh.family = AF_INET6; ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst); - ipc6.tclass = np->tclass; ipc6.dontfrag = np->dontfrag; ipc6.opt = NULL; |