mptcp: fix bad handling of 32 bit ack wrap-around
authorPaolo Abeni <pabeni@redhat.com>
Fri, 18 Jun 2021 22:02:20 +0000 (15:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2021 21:21:27 +0000 (14:21 -0700)
commit1502328f17ab0684ca5ed6764433aa0a83bdaf95
tree816b6ae5767f7c2e6eb08d2d3d3065047e95bc69
parentd452d48b9f8b1a7f8152d33ef52cfd7fe1735b0a
mptcp: fix bad handling of 32 bit ack wrap-around

When receiving 32 bits DSS ack from the peer, the MPTCP need
to expand them to 64 bits value. The current code is buggy
WRT detecting 32 bits ack wrap-around: when the wrap-around
happens the current unsigned 32 bit ack value is lower than
the previous one.

Additionally check for possible reverse wrap and make the helper
visible, so that we could re-use it for the next patch.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/204
Fixes: cc9d25669866 ("mptcp: update per unacked sequence on pkt reception")
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/options.c
net/mptcp/protocol.h