Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/reass.c

    rfc6abbe rfeeac0d  
    196196                return ENOMEM;
    197197
    198         memcpy(data_copy, packet->data, packet->size);
    199 
    200198        frag->packet = *packet;
    201199        frag->packet.data = data_copy;
     
    218216                        break;
    219217
    220                 link = list_next(link, &rdg->frags);
     218                link = link->next;
    221219        }
    222220
     
    242240        assert(!list_empty(&rdg->frags));
    243241
    244         link = list_first(&rdg->frags);
    245         assert(link != NULL);
    246 
    247         frag = list_get_instance(link, reass_frag_t,
     242        /* First fragment must be at offset zero */
     243        frag = list_get_instance(list_first(&rdg->frags), reass_frag_t,
    248244            dgram_link);
    249 
    250         /* First fragment must be at offset zero */
    251245        if (frag->packet.offs != 0)
    252246                return false;
    253247
    254248        prev = frag;
    255 
    256249        while (true) {
    257                 link = list_next(link, &rdg->frags);
     250                link = frag->dgram_link.next;
    258251                if (link == NULL)
    259                         break;
     252                        return false;
    260253
    261254                /* Each next fragment must follow immediately or overlap */
     
    295288        uint8_t proto;
    296289        reass_frag_t *frag;
    297         int rc;
    298290
    299291        /*
     
    315307
    316308        /* Upper bound for fragment offset field */
    317         fragoff_limit = 1 << (FF_FRAGOFF_h - FF_FRAGOFF_l + 1);
     309        fragoff_limit = 1 << (FF_FRAGOFF_h - FF_FRAGOFF_l);
    318310
    319311        /* Verify that total size of datagram is within reasonable bounds */
     
    351343        }
    352344
    353         rc = inet_recv_dgram_local(&dgram, proto);
    354         free(dgram.data);
    355         return rc;
     345        return inet_recv_dgram_local(&dgram, proto);
    356346}
    357347
Note: See TracChangeset for help on using the changeset viewer.