]> sjero.net Git - dccp2tcp/commitdiff
Handle connections whose request/response was never seen
authorSamuel Jero <sj323707@ohio.edu>
Wed, 16 Nov 2011 06:03:58 +0000 (01:03 -0500)
committerSamuel Jero <sj323707@ohio.edu>
Wed, 16 Nov 2011 06:03:58 +0000 (01:03 -0500)
dccp2tcp.c

index c8cc769d1068397c0810ee30f2688785adf7f9f6..a1a036ac76a20e94ee2fab17e416fe44d0e1670c 100644 (file)
@@ -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){