summaryrefslogtreecommitdiffstats
path: root/net/tipc/link.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-10-15 14:52:42 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-15 23:55:20 -0700
commit81204c492b05274ade680c54787cd8ba234dcfd7 (patch)
tree27f60c46cc27e231e6ea4a1137decddb5a3f5f92 /net/tipc/link.h
parentf9aa358a8109f9f33e96c3a7efb9a07631670294 (diff)
downloadlinux-stable-81204c492b05274ade680c54787cd8ba234dcfd7.tar.gz
linux-stable-81204c492b05274ade680c54787cd8ba234dcfd7.tar.bz2
linux-stable-81204c492b05274ade680c54787cd8ba234dcfd7.zip
tipc: improve sequence number checking
The sequence number of an incoming packet is currently only checked for less than, equality to, or bigger than the next expected number, meaning that the receive window in practice becomes one half sequence number cycle, or U16_MAX/2. This does not make sense, and may not even be safe if there are extreme delays in the network. Any packet sent by the peer during the ongoing cycle must belong inside his current send window, or should otherwise be dropped if possible. Since a link endpoint cannot know its peer's current send window, it has to base this sanity check on a worst-case assumption, i.e., that the peer is using a maximum sized window of 8191 packets. Using this assumption, we now add a check that the sequence number is not bigger than next_expected + TIPC_MAX_LINK_WIN. We also re-order the checks done, so that the receive window test is performed before the gap test. This way, we are guaranteed that no packet with illegal sequence numbers are ever added to the deferred queue. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.h')
-rw-r--r--net/tipc/link.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 39ff8b6919a4..7a1ad4294b7a 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -185,7 +185,7 @@ struct tipc_link {
} backlog[5];
u16 snd_nxt;
u16 last_retransm;
- u32 window;
+ u16 window;
u32 stale_count;
/* Reception */