aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2009-04-27 16:38:31 -0400
committerRoland Dreier <rolandd@cisco.com>2009-04-27 16:38:31 -0400
commitc11470f9f4d4490cd7e9563f604c4c7868caf6de (patch)
tree3fec0b3fac5499d1c6812a5bcd4ae19cd57d4831 /drivers/infiniband
parent53094c388f11d79f742eaf743c9fd740a881f2c0 (diff)
RDMA/nes: Check for sequence number wrap-around
check_seq() was not checking if the seq#s have wrapped. Fix it. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 1efe0beca063..1f7a659e6e9a 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -56,6 +56,7 @@
56#include <net/neighbour.h> 56#include <net/neighbour.h>
57#include <net/route.h> 57#include <net/route.h>
58#include <net/ip_fib.h> 58#include <net/ip_fib.h>
59#include <net/tcp.h>
59 60
60#include "nes.h" 61#include "nes.h"
61 62
@@ -1514,7 +1515,7 @@ static int check_seq(struct nes_cm_node *cm_node, struct tcphdr *tcph,
1514 rcv_wnd = cm_node->tcp_cntxt.rcv_wnd; 1515 rcv_wnd = cm_node->tcp_cntxt.rcv_wnd;
1515 if (ack_seq != loc_seq_num) 1516 if (ack_seq != loc_seq_num)
1516 err = 1; 1517 err = 1;
1517 else if ((seq + rcv_wnd) < rcv_nxt) 1518 else if (!between(seq, rcv_nxt, (rcv_nxt+rcv_wnd)))
1518 err = 1; 1519 err = 1;
1519 if (err) { 1520 if (err) {
1520 nes_debug(NES_DBG_CM, "%s[%u] create abort for cm_node=%p " 1521 nes_debug(NES_DBG_CM, "%s[%u] create abort for cm_node=%p "