Changes in uspace/srv/net/inetsrv/reass.c [feeac0d:a1a101d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/reass.c
rfeeac0d ra1a101d 129 129 assert(fibril_mutex_is_locked(&reass_dgram_map_lock)); 130 130 131 list_foreach(reass_dgram_map, map_link, reass_dgram_t, rdg) { 131 list_foreach(reass_dgram_map, link) { 132 reass_dgram_t *rdg = list_get_instance(link, reass_dgram_t, 133 map_link); 134 132 135 link_t *f1_link = list_first(&rdg->frags); 133 136 assert(f1_link != NULL); … … 136 139 dgram_link); 137 140 138 if ( (inet_addr_compare(&f1->packet.src, &packet->src))&&139 (inet_addr_compare(&f1->packet.dest, &packet->dest))&&140 (f1->packet.proto == packet->proto)&&141 (f1->packet.ident == packet->ident)) {141 if (f1->packet.src.ipv4 == packet->src.ipv4 && 142 f1->packet.dest.ipv4 == packet->dest.ipv4 && 143 f1->packet.proto == packet->proto && 144 f1->packet.ident == packet->ident) { 142 145 /* Match */ 143 146 return rdg; … … 161 164 return NULL; 162 165 163 li st_append(&rdg->map_link, &reass_dgram_map);166 link_initialize(&rdg->map_link); 164 167 list_initialize(&rdg->frags); 165 168 … … 286 289 size_t fragoff_limit; 287 290 inet_dgram_t dgram; 291 reass_frag_t *frag; 288 292 uint8_t proto; 289 reass_frag_t *frag;290 293 291 294 /* … … 294 297 */ 295 298 frag = NULL; 296 list_foreach(rdg->frags, dgram_link, reass_frag_t, cfrag) { 297 if (!cfrag->packet.mf) { 298 frag = cfrag; 299 list_foreach(rdg->frags, link) { 300 frag = list_get_instance(link, reass_frag_t, dgram_link); 301 302 if (!frag->packet.mf) 299 303 break; 300 }301 304 } 302 305 … … 327 330 size_t doffs = 0; 328 331 329 list_foreach(rdg->frags, dgram_link, reass_frag_t, cfrag) { 332 frag = NULL; 333 list_foreach(rdg->frags, link) { 334 frag = list_get_instance(link, reass_frag_t, dgram_link); 335 330 336 size_t cb, ce; 331 337 332 cb = max(doffs, cfrag->packet.offs);333 ce = min(dgram_size, cfrag->packet.offs + cfrag->packet.size);338 cb = max(doffs, frag->packet.offs); 339 ce = min(dgram_size, frag->packet.offs + frag->packet.size); 334 340 335 341 if (ce > cb) { 336 342 memcpy(dgram.data + cb, 337 cfrag->packet.data + cb - cfrag->packet.offs,343 frag->packet.data + cb - frag->packet.offs, 338 344 ce - cb); 339 345 } 340 346 341 if (! cfrag->packet.mf)347 if (!frag->packet.mf) 342 348 break; 343 349 }
Note:
See TracChangeset
for help on using the changeset viewer.