diff options
author | David Howells <dhowells@redhat.com> | 2018-10-08 10:46:11 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-10-08 17:42:04 -0400 |
commit | 298bc15b2079c324e82d0a6fda39c3d762af7282 (patch) | |
tree | 4c40d298df2ee83702d152bf8b163c60769c3e99 /net/rxrpc | |
parent | dfe995224693798e554ab4770f6d8a096afc60cd (diff) |
rxrpc: Only take the rwind and mtu values from latest ACK
Move the out-of-order and duplicate ACK packet check to before the call to
rxrpc_input_ackinfo() so that the receive window size and MTU size are only
checked in the latest ACK packet and don't regress.
Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/input.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index af8ce64f4162..04213a65c1ac 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c | |||
@@ -868,6 +868,16 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, | |||
868 | rxrpc_propose_ack_respond_to_ack); | 868 | rxrpc_propose_ack_respond_to_ack); |
869 | } | 869 | } |
870 | 870 | ||
871 | /* Discard any out-of-order or duplicate ACKs. */ | ||
872 | if (before_eq(sp->hdr.serial, call->acks_latest)) { | ||
873 | _debug("discard ACK %d <= %d", | ||
874 | sp->hdr.serial, call->acks_latest); | ||
875 | return; | ||
876 | } | ||
877 | call->acks_latest_ts = skb->tstamp; | ||
878 | call->acks_latest = sp->hdr.serial; | ||
879 | |||
880 | /* Parse rwind and mtu sizes if provided. */ | ||
871 | ioffset = offset + nr_acks + 3; | 881 | ioffset = offset + nr_acks + 3; |
872 | if (skb->len >= ioffset + sizeof(buf.info)) { | 882 | if (skb->len >= ioffset + sizeof(buf.info)) { |
873 | if (skb_copy_bits(skb, ioffset, &buf.info, sizeof(buf.info)) < 0) | 883 | if (skb_copy_bits(skb, ioffset, &buf.info, sizeof(buf.info)) < 0) |
@@ -889,15 +899,6 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, | |||
889 | return; | 899 | return; |
890 | } | 900 | } |
891 | 901 | ||
892 | /* Discard any out-of-order or duplicate ACKs. */ | ||
893 | if (before_eq(sp->hdr.serial, call->acks_latest)) { | ||
894 | _debug("discard ACK %d <= %d", | ||
895 | sp->hdr.serial, call->acks_latest); | ||
896 | return; | ||
897 | } | ||
898 | call->acks_latest_ts = skb->tstamp; | ||
899 | call->acks_latest = sp->hdr.serial; | ||
900 | |||
901 | if (before(hard_ack, call->tx_hard_ack) || | 902 | if (before(hard_ack, call->tx_hard_ack) || |
902 | after(hard_ack, call->tx_top)) | 903 | after(hard_ack, call->tx_top)) |
903 | return rxrpc_proto_abort("AKW", call, 0); | 904 | return rxrpc_proto_abort("AKW", call, 0); |