Changes in uspace/srv/net/inetsrv/reass.c [feeac0d:fc6abbe] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/reass.c
rfeeac0d rfc6abbe 196 196 return ENOMEM; 197 197 198 memcpy(data_copy, packet->data, packet->size); 199 198 200 frag->packet = *packet; 199 201 frag->packet.data = data_copy; … … 216 218 break; 217 219 218 link = li nk->next;220 link = list_next(link, &rdg->frags); 219 221 } 220 222 … … 240 242 assert(!list_empty(&rdg->frags)); 241 243 244 link = list_first(&rdg->frags); 245 assert(link != NULL); 246 247 frag = list_get_instance(link, reass_frag_t, 248 dgram_link); 249 242 250 /* First fragment must be at offset zero */ 243 frag = list_get_instance(list_first(&rdg->frags), reass_frag_t,244 dgram_link);245 251 if (frag->packet.offs != 0) 246 252 return false; 247 253 248 254 prev = frag; 255 249 256 while (true) { 250 link = frag->dgram_link.next;257 link = list_next(link, &rdg->frags); 251 258 if (link == NULL) 252 return false;259 break; 253 260 254 261 /* Each next fragment must follow immediately or overlap */ … … 288 295 uint8_t proto; 289 296 reass_frag_t *frag; 297 int rc; 290 298 291 299 /* … … 307 315 308 316 /* Upper bound for fragment offset field */ 309 fragoff_limit = 1 << (FF_FRAGOFF_h - FF_FRAGOFF_l );317 fragoff_limit = 1 << (FF_FRAGOFF_h - FF_FRAGOFF_l + 1); 310 318 311 319 /* Verify that total size of datagram is within reasonable bounds */ … … 343 351 } 344 352 345 return inet_recv_dgram_local(&dgram, proto); 353 rc = inet_recv_dgram_local(&dgram, proto); 354 free(dgram.data); 355 return rc; 346 356 } 347 357
Note:
See TracChangeset
for help on using the changeset viewer.