Rev 4053 | Rev 4259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4053 | Rev 4258 | ||
---|---|---|---|
Line 317... | Line 317... | ||
317 | .has_fragments: |
317 | .has_fragments: |
318 | movzx eax, [edx + IPv4_header.FlagsAndFragmentOffset] |
318 | movzx eax, [edx + IPv4_header.FlagsAndFragmentOffset] |
319 | xchg al, ah |
319 | xchg al, ah |
320 | shl ax, 3 |
320 | shl ax, 3 |
Line 321... | Line 321... | ||
321 | 321 | ||
Line 322... | Line 322... | ||
322 | DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: fragmented packet offset=%u id=%x\n", ax, [edx + IPv4_header.Identification]:4 |
322 | DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: fragmented packet offset=%u id=%x ptr=0x%x\n", ax, [edx + IPv4_header.Identification]:4, edx |
323 | 323 | ||
Line 472... | Line 472... | ||
472 | je .first_fragment |
472 | je .first_fragment |
473 | sub cx, bx ; If not, dont copy the header |
473 | sub cx, bx ; If not, dont copy the header |
474 | add esi, ebx ; |
474 | add esi, ebx ; |
475 | .first_fragment: |
475 | .first_fragment: |
Line -... | Line 476... | ||
- | 476 | ||
- | 477 | ||
476 | 478 | DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: Copying %u bytes from 0x%x to 0x%x\n", ecx, esi, edi |
|
477 | push cx ; First copy dword-wise, then byte-wise |
479 | push cx ; First copy dword-wise, then byte-wise |
478 | shr cx, 2 ; |
480 | shr cx, 2 ; |
479 | rep movsd ; |
481 | rep movsd ; |
480 | pop cx ; |
482 | pop cx ; |
481 | and cx, 3 ; |
483 | and cx, 3 ; |
Line 482... | Line 484... | ||
482 | rep movsb ; |
484 | rep movsb ; |
- | 485 | ||
- | 486 | push eax |
|
483 | 487 | push [edx + IPv4_FRAGMENT_entry.Owner] ; we need to remeber the owner, in case this is the last packet |
|
484 | push eax |
- | |
485 | push edx ; Push pointer to fragment onto stack |
488 | push [edx + IPv4_FRAGMENT_entry.NextPtr] ; Set edx to the next pointer |
486 | mov ebx, [edx + IPv4_FRAGMENT_entry.Owner] ; we need to remeber the owner, in case this is the last packet |
489 | push edx ; Push pointer to fragment onto stack |
487 | mov edx, [edx + IPv4_FRAGMENT_entry.NextPtr] ; Set edx to the next pointer |
490 | DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: Next Fragment: 0x%x\n", edx |
488 | call NET_packet_free ; free the previous fragment buffer (this uses the value from stack) |
491 | call NET_packet_free ; free the previous fragment buffer (this uses the value from stack) |
489 | pop eax |
492 | pop edx ebx eax |
Line 490... | Line 493... | ||
490 | cmp edx, -1 ; Check if it is last fragment in chain |
493 | cmp edx, -1 ; Check if it is last fragment in chain |
491 | jne .rebuild_packet_loop |
494 | jne .rebuild_packet_loop |
Line 496... | Line 499... | ||
496 | mov [edx + IPv4_header.TotalLength], cx |
499 | mov [edx + IPv4_header.TotalLength], cx |
497 | add esp, 8 |
500 | add esp, 8 |
498 | xchg cl, ch |
501 | xchg cl, ch |
499 | push ecx |
502 | push ecx |
Line -... | Line 503... | ||
- | 503 | ||
- | 504 | DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: Packet is now de-fragmented\n" |
|
500 | 505 | ||
501 | push eax |
506 | push eax |
Line 502... | Line 507... | ||
502 | jmp .handle_it ; edx = buf ptr, ecx = size, [esp] buf ptr, [esp+4], total size, ebx=device ptr |
507 | jmp .handle_it ; edx = buf ptr, ecx = size, [esp] buf ptr, [esp+4], total size, ebx=device ptr |
503 | 508 |