diff options
author | Florent Fourcot <florent.fourcot@enst-bretagne.fr> | 2014-01-16 11:21:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-17 20:56:33 -0500 |
commit | 1d13a96c74fc4802a775189ddb58bc6469ffdaa3 (patch) | |
tree | bf854b523585d551146a82d12d429ab19ae6ef3c /net/ipv6 | |
parent | d037c4d70fb281cd54efb03254b51c7452750491 (diff) |
ipv6: tcp: fix flowlabel value in ACK messages send from TIME_WAIT
This patch is following the commit b903d324bee262 (ipv6: tcp: fix TCLASS
value in ACK messages sent from TIME_WAIT).
For the same reason than tclass, we have to store the flow label in the
inet_timewait_sock to provide consistency of flow label on the last ACK.
Signed-off-by: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index ffd5fa8bdb15..b5512696e9ed 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -724,7 +724,8 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { | |||
724 | 724 | ||
725 | static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | 725 | static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, |
726 | u32 tsval, u32 tsecr, | 726 | u32 tsval, u32 tsecr, |
727 | struct tcp_md5sig_key *key, int rst, u8 tclass) | 727 | struct tcp_md5sig_key *key, int rst, u8 tclass, |
728 | u32 label) | ||
728 | { | 729 | { |
729 | const struct tcphdr *th = tcp_hdr(skb); | 730 | const struct tcphdr *th = tcp_hdr(skb); |
730 | struct tcphdr *t1; | 731 | struct tcphdr *t1; |
@@ -786,6 +787,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
786 | memset(&fl6, 0, sizeof(fl6)); | 787 | memset(&fl6, 0, sizeof(fl6)); |
787 | fl6.daddr = ipv6_hdr(skb)->saddr; | 788 | fl6.daddr = ipv6_hdr(skb)->saddr; |
788 | fl6.saddr = ipv6_hdr(skb)->daddr; | 789 | fl6.saddr = ipv6_hdr(skb)->daddr; |
790 | fl6.flowlabel = label; | ||
789 | 791 | ||
790 | buff->ip_summed = CHECKSUM_PARTIAL; | 792 | buff->ip_summed = CHECKSUM_PARTIAL; |
791 | buff->csum = 0; | 793 | buff->csum = 0; |
@@ -871,7 +873,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | |||
871 | ack_seq = ntohl(th->seq) + th->syn + th->fin + skb->len - | 873 | ack_seq = ntohl(th->seq) + th->syn + th->fin + skb->len - |
872 | (th->doff << 2); | 874 | (th->doff << 2); |
873 | 875 | ||
874 | tcp_v6_send_response(skb, seq, ack_seq, 0, 0, 0, key, 1, 0); | 876 | tcp_v6_send_response(skb, seq, ack_seq, 0, 0, 0, key, 1, 0, 0); |
875 | 877 | ||
876 | #ifdef CONFIG_TCP_MD5SIG | 878 | #ifdef CONFIG_TCP_MD5SIG |
877 | release_sk1: | 879 | release_sk1: |
@@ -884,9 +886,11 @@ release_sk1: | |||
884 | 886 | ||
885 | static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, | 887 | static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, |
886 | u32 win, u32 tsval, u32 tsecr, | 888 | u32 win, u32 tsval, u32 tsecr, |
887 | struct tcp_md5sig_key *key, u8 tclass) | 889 | struct tcp_md5sig_key *key, u8 tclass, |
890 | u32 label) | ||
888 | { | 891 | { |
889 | tcp_v6_send_response(skb, seq, ack, win, tsval, tsecr, key, 0, tclass); | 892 | tcp_v6_send_response(skb, seq, ack, win, tsval, tsecr, key, 0, tclass, |
893 | label); | ||
890 | } | 894 | } |
891 | 895 | ||
892 | static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) | 896 | static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) |
@@ -898,7 +902,7 @@ static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) | |||
898 | tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, | 902 | tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, |
899 | tcp_time_stamp + tcptw->tw_ts_offset, | 903 | tcp_time_stamp + tcptw->tw_ts_offset, |
900 | tcptw->tw_ts_recent, tcp_twsk_md5_key(tcptw), | 904 | tcptw->tw_ts_recent, tcp_twsk_md5_key(tcptw), |
901 | tw->tw_tclass); | 905 | tw->tw_tclass, (tw->tw_flowlabel << 12)); |
902 | 906 | ||
903 | inet_twsk_put(tw); | 907 | inet_twsk_put(tw); |
904 | } | 908 | } |
@@ -908,7 +912,8 @@ static void tcp_v6_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, | |||
908 | { | 912 | { |
909 | tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, | 913 | tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, |
910 | req->rcv_wnd, tcp_time_stamp, req->ts_recent, | 914 | req->rcv_wnd, tcp_time_stamp, req->ts_recent, |
911 | tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr), 0); | 915 | tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr), |
916 | 0, 0); | ||
912 | } | 917 | } |
913 | 918 | ||
914 | 919 | ||