From: Samuel Jero Date: Wed, 16 Nov 2011 06:03:58 +0000 (-0500) Subject: Handle connections whose request/response was never seen X-Git-Url: http://sjero.net/git/?p=dccp2tcp;a=commitdiff_plain;h=d4fcf97617a831d17c5250be16cb6f83bec7b1d3 Handle connections whose request/response was never seen --- diff --git a/dccp2tcp.c b/dccp2tcp.c index c8cc769..a1a036a 100644 --- a/dccp2tcp.c +++ b/dccp2tcp.c @@ -585,8 +585,8 @@ u_int32_t add_new_seq(struct host *seq, __be32 num, int size, enum dccp_pkt_type } if(seq->table==NULL){ - dbgprintf(1, "Warning: Connection initialization incorrect\n"); - return 0; + dbgprintf(1, "Warning: Connection uninitialized\n"); + return initialize_seq(seq, 0, num); } /*account for missing packets*/ @@ -631,6 +631,11 @@ u_int32_t convert_ack(struct host *seq, __be32 num) exit(1); } + if(seq->table==NULL){ + dbgprintf(1, "Warning: Connection uninitialized\n"); + initialize_seq(seq, 0, num); + } + /*loop through table looking for the DCCP ack number*/ for(int i=0; i < seq->size; i++){ if(seq->table[i].old==num){ @@ -651,6 +656,11 @@ int acked_packet_size(struct host *seq, __be32 num) exit(1); } + if(seq->table==NULL){ + dbgprintf(1, "Warning: Connection uninitialized\n"); + initialize_seq(seq, 0, num); + } + /*loop through table looking for the DCCP ack number*/ for(int i=0; i < seq->size; i++){ if(seq->table[i].old==num){