Merge tag 'befs-v4.9-rc1' of git://github.com/luisbg/linux-befs
[cascardo/linux.git] / net / l2tp / l2tp_ip6.c
index 6c54e03..ea2ae66 100644 (file)
@@ -611,6 +611,11 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 
        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_dst_lookup_flow(sk, &fl6, final_p);
        if (IS_ERR(dst)) {
                err = PTR_ERR(dst);
@@ -620,9 +625,6 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
        if (ipc6.hlimit < 0)
                ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
 
-       if (ipc6.tclass < 0)
-               ipc6.tclass = np->tclass;
-
        if (ipc6.dontfrag < 0)
                ipc6.dontfrag = np->dontfrag;