Changeset 0c2d9bb in mainline for uspace/srv/net/inetsrv/reass.c


Ignore:
Timestamp:
2013-12-25T22:54:29Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

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

    rf7a33de r0c2d9bb  
    129129        assert(fibril_mutex_is_locked(&reass_dgram_map_lock));
    130130
    131         list_foreach(reass_dgram_map, link) {
    132                 reass_dgram_t *rdg = list_get_instance(link, reass_dgram_t,
    133                     map_link);
    134 
     131        list_foreach(reass_dgram_map, map_link, reass_dgram_t, rdg) {
    135132                link_t *f1_link = list_first(&rdg->frags);
    136133                assert(f1_link != NULL);
     
    289286        size_t fragoff_limit;
    290287        inet_dgram_t dgram;
     288        uint8_t proto;
    291289        reass_frag_t *frag;
    292         uint8_t proto;
    293290
    294291        /*
     
    297294         */
    298295        frag = NULL;
    299         list_foreach(rdg->frags, link) {
    300                 frag = list_get_instance(link, reass_frag_t, dgram_link);
    301 
    302                 if (!frag->packet.mf)
     296        list_foreach(rdg->frags, dgram_link, reass_frag_t, cfrag) {
     297                if (!cfrag->packet.mf) {
     298                        frag = cfrag;
    303299                        break;
     300                }
    304301        }
    305302
     
    330327        size_t doffs = 0;
    331328
    332         frag = NULL;
    333         list_foreach(rdg->frags, link) {
    334                 frag = list_get_instance(link, reass_frag_t, dgram_link);
    335 
     329        list_foreach(rdg->frags, dgram_link, reass_frag_t, cfrag) {
    336330                size_t cb, ce;
    337331
    338                 cb = max(doffs, frag->packet.offs);
    339                 ce = min(dgram_size, frag->packet.offs + frag->packet.size);
     332                cb = max(doffs, cfrag->packet.offs);
     333                ce = min(dgram_size, cfrag->packet.offs + cfrag->packet.size);
    340334
    341335                if (ce > cb) {
    342336                        memcpy(dgram.data + cb,
    343                             frag->packet.data + cb - frag->packet.offs,
     337                            cfrag->packet.data + cb - cfrag->packet.offs,
    344338                            ce - cb);
    345339                }
    346340
    347                 if (!frag->packet.mf)
     341                if (!cfrag->packet.mf)
    348342                        break;
    349343        }
Note: See TracChangeset for help on using the changeset viewer.