Commit c11470f9 authored by Faisal Latif's avatar Faisal Latif Committed by Roland Dreier

RDMA/nes: Check for sequence number wrap-around

check_seq() was not checking if the seq#s have wrapped.  Fix it.
Signed-off-by: default avatarFaisal Latif <faisal.latif@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 53094c38
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/route.h> #include <net/route.h>
#include <net/ip_fib.h> #include <net/ip_fib.h>
#include <net/tcp.h>
#include "nes.h" #include "nes.h"
...@@ -1514,7 +1515,7 @@ static int check_seq(struct nes_cm_node *cm_node, struct tcphdr *tcph, ...@@ -1514,7 +1515,7 @@ static int check_seq(struct nes_cm_node *cm_node, struct tcphdr *tcph,
rcv_wnd = cm_node->tcp_cntxt.rcv_wnd; rcv_wnd = cm_node->tcp_cntxt.rcv_wnd;
if (ack_seq != loc_seq_num) if (ack_seq != loc_seq_num)
err = 1; err = 1;
else if ((seq + rcv_wnd) < rcv_nxt) else if (!between(seq, rcv_nxt, (rcv_nxt+rcv_wnd)))
err = 1; err = 1;
if (err) { if (err) {
nes_debug(NES_DBG_CM, "%s[%u] create abort for cm_node=%p " nes_debug(NES_DBG_CM, "%s[%u] create abort for cm_node=%p "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment