240,16 → 240,16 |
mov edx, IP_PROTO_TCP |
|
; source address |
add dl, byte [IP1+1] |
adc dh, byte [IP1+0] |
adc dl, byte [IP1+3] |
adc dh, byte [IP1+2] |
add dl, byte [IP1+1+4] |
adc dh, byte [IP1+0+4] |
adc dl, byte [IP1+3+4] |
adc dh, byte [IP1+2+4] |
|
; destination address |
adc dl, byte [IP2+1] |
adc dh, byte [IP2+0] |
adc dl, byte [IP2+3] |
adc dh, byte [IP2+2] |
adc dl, byte [IP2+1+8] |
adc dh, byte [IP2+0+8] |
adc dl, byte [IP2+3+8] |
adc dh, byte [IP2+2+8] |
|
; size |
adc dl, cl |
306,7 → 306,7 |
mov [edx + TCP_segment.Checksum], 0 |
push esi edi |
mov esi, edx |
TCP_checksum (esp), (esp+4) |
TCP_checksum |
pop esi edi ; yes, swap them (we dont need dest addr) |
pop cx ; previous checksum |
cmp cx, dx |
437,7 → 437,7 |
|
DEBUGF 1,"Segment has options\n" |
|
cmp [ebx + TCP_SOCKET.t_state], TCB_LISTEN ; no options when in listen state |
test [ebx + TCP_SOCKET.t_state], TCB_LISTEN ; no options when in listen state |
jz .no_options |
|
lea edi, [edx + TCP_segment.Data] |
475,12 → 475,9 |
test [edx + TCP_segment.Flags], TH_SYN |
jz @f |
|
movzx eax, word[edi+2] |
rol ax, 8 |
DEBUGF 1,"Maxseg: %u", ax |
DEBUGF 1,"Got maxseg option" |
|
mov [ebx + TCP_SOCKET.t_maxseg], eax |
|
;;;;; |
@@: |
add edi, 4 |
jmp .opt_loop |
1761,8 → 1758,8 |
pop ecx |
add esp, ecx |
|
mov [esp + 4+4], edx ; packet size |
mov [esp + 4], eax ; packet ptr |
mov [esp + 3*4+4], edx ; packet size |
mov [esp + 3*4], eax ; packet ptr |
|
mov edx, edi |
sub edx, ecx |
1785,6 → 1782,8 |
; Create the checksum (we have already pushed IPs onto stack) |
|
DEBUGF 1,"checksum: ptr=%x size=%u\n", esi, ecx |
DEBUGF 1,"ip=%x\n", [esp]:8 |
DEBUGF 1,"ip=%x\n", [esp+4]:8 |
|
TCP_checksum (eax + IP_SOCKET.LocalIP), (eax + IP_SOCKET.RemoteIP) |
mov [esi+TCP_segment.Checksum], dx |