Added TCP_mss (max segment size) stub.

Bugfix in FTPD concerning data ports.

git-svn-id: svn://kolibrios.org@3144 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-12-29 22:22:10 +00:00
parent 14077f9230
commit 949b920321
4 changed files with 26 additions and 3 deletions

View File

@ -720,8 +720,9 @@ cmdPASV:
.next_port: ; TODO: break the endless loop
call nextpasvport
pushw [pasv_port]
popw [ebp + thread_data.datasock.sin_port]
mov ax, [pasv_port]
xchg al, ah
mov [ebp + thread_data.datasock.sin_port], ax
mcall bind
cmp eax, -1

View File

@ -51,6 +51,9 @@ ABORT = 1 shl 31
format binary as ""
use32
org 0x0
db 'MENUET01' ; signature
dd 1 ; header version
dd start ; entry point
@ -119,6 +122,7 @@ start:
invoke con_start, 1
invoke con_init, -1, -1, -1, -1, title
; get settings from ini
invoke ini.get_str, path, str_ftpd, str_ip, ini_buf, 16, 0
mov esi, ini_buf
mov cl, '.'
@ -133,6 +137,7 @@ start:
invoke con_printf, str1, eax
add esp, 8
; open listening socket
mcall socket, AF_INET4, SOCK_STREAM, 0
cmp eax, -1
je sock_err

View File

@ -243,7 +243,7 @@ TCP_input:
lodsw
rol ax, 8
DEBUGF 1,"TCP_input: Maxseg=%u\n", ax
mov [ebx + TCP_SOCKET.t_maxseg], eax
call TCP_mss
@@:
jmp .opt_loop

View File

@ -594,3 +594,20 @@ TCP_xmit_timer:
pop ecx
ret
; eax = max segment size
; ebx = socket ptr
align 4
TCP_mss:
cmp eax, 1420 ; FIXME
jbe @f
mov eax, 1420
@@:
mov [ebx + TCP_SOCKET.t_maxseg], eax
ret