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