aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d2ce66b23430..b620d9b72e59 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -803,6 +803,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
803 unsigned int tot_len = sizeof(struct tcphdr); 803 unsigned int tot_len = sizeof(struct tcphdr);
804 struct dst_entry *dst; 804 struct dst_entry *dst;
805 __be32 *topt; 805 __be32 *topt;
806 __u32 mark = 0;
806 807
807 if (tsecr) 808 if (tsecr)
808 tot_len += TCPOLEN_TSTAMP_ALIGNED; 809 tot_len += TCPOLEN_TSTAMP_ALIGNED;
@@ -871,7 +872,10 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
871 fl6.flowi6_oif = oif; 872 fl6.flowi6_oif = oif;
872 } 873 }
873 874
874 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark); 875 if (sk)
876 mark = (sk->sk_state == TCP_TIME_WAIT) ?
877 inet_twsk(sk)->tw_mark : sk->sk_mark;
878 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark) ?: mark;
875 fl6.fl6_dport = t1->dest; 879 fl6.fl6_dport = t1->dest;
876 fl6.fl6_sport = t1->source; 880 fl6.fl6_sport = t1->source;
877 fl6.flowi6_uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); 881 fl6.flowi6_uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL);
@@ -1318,7 +1322,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
1318 } 1322 }
1319 } 1323 }
1320 1324
1321 tcp_rcv_established(sk, skb, tcp_hdr(skb)); 1325 tcp_rcv_established(sk, skb);
1322 if (opt_skb) 1326 if (opt_skb)
1323 goto ipv6_pktoptions; 1327 goto ipv6_pktoptions;
1324 return 0; 1328 return 0;