Compare commits

..
Author SHA1 Message Date
Leency 92bcb4a591 kernel: fix sysfn 68.30 (unload driver)
- restore the SRV handle after DRV_EXIT (ecx is clobbered by the driver)
- restore esp via ebp: START may be cdecl or stdcall
- pass the SRV to free in eax, not on the stack
- check SRV.base before calling DRV_EXIT
2026-09-30 11:23:02 +03:00
4 changed files with 21 additions and 28 deletions

No files matched your search

+15 -13
View File
@@ -1233,25 +1233,27 @@ f68:
mov eax, [ecx + SRV.entry]
test eax, eax
jz .fail
push ecx ;save handl
mov eax, -2 ;error free RAM
cmp [ecx + SRV.base], 0
je .fail
push ecx ;save handl
mov ebp, esp ;START may be cdecl or stdcall
push edx ;cmdline
push DRV_EXIT
call eax ;the result is not checked
lea esp, [esp+8]
push ecx
call [ecx + SRV.entry] ;the result is not checked
mov esp, ebp
pop esi
mov ebx, [ecx + SRV.base]
mov eax, -2 ;error free RAM
test ebx, ebx
jz .fail
stdcall kernel_free, ebx ;del driver
mov eax, [ecx + SRV.fd]
mov edx, [ecx + SRV.bk]
mov eax, [esi + SRV.fd]
mov edx, [esi + SRV.bk]
mov [edx + SRV.fd], eax
mov [eax + SRV.bk], edx
stdcall free, ecx
push eax
stdcall kernel_free, [esi + SRV.base] ;del driver
mov eax, esi
call free ;eax = mem
pop eax
;dec [count_services]
mov [esp + SYSCALL_STACK.eax], eax
+1 -1
View File
@@ -72,7 +72,7 @@ TCP_time_rtt_default = 5 ; default Round Trip Time (3,2s)
TCP_time_srtt_default = 0 ;
TCP_time_max_idle = 8*TCP_time_keep_interval ; FIXME
TCP_time_connect = 1000 ; in 1/100s (default=10s)
TCP_time_connect = 300 ; in 1/100s (default=3s)
; timer constants
TCP_max_rxtshift = 12 ; max retransmissions waiting for ACK
+1 -2
View File
@@ -399,7 +399,6 @@ endl
bswap eax
mov [ebx + TCP_SOCKET.ts_val], eax
lodsd ; timestamp echo reply
bswap eax
mov [ebx + TCP_SOCKET.ts_ecr], eax
or [temp_bits], TCP_BIT_TIMESTAMP
@@ -979,7 +978,7 @@ endl
inc [ebx + TCP_SOCKET.t_dupacks]
cmp [ebx + TCP_SOCKET.t_dupacks], TCP_re_xmit_thresh
jb .ack_processed
jb .dup_ack_complete
ja .another_lost
DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: Re-transmitting lost segment\n"
+4 -12
View File
@@ -391,14 +391,8 @@ endl
jz .no_timestamp
.timestamp:
push ebx
mov ebx, [eax + TCP_SOCKET.ts_recent]
bswap ebx
xchg ebx, [esp] ; TSecr
push ebx
mov ebx, [timer_ticks]
bswap ebx
xchg ebx, [esp] ; TSval
pushd 0
pushd [timer_ticks]
pushd TCP_OPT_NOP + TCP_OPT_NOP shl 8 + TCP_OPT_TIMESTAMP shl 16 + 10 shl 24
add di, 12
@@ -419,12 +413,10 @@ endl
; check if we don't exceed the max segment size
add esi, edi ; total TCP segment size
mov ebx, [eax + TCP_SOCKET.t_maxseg]
add ebx, sizeof.TCP_header ; MSS does not count the header
cmp esi, ebx
cmp esi, [eax + TCP_SOCKET.t_maxseg]
jbe .no_overflow
mov esi, ebx
mov esi, [eax + TCP_SOCKET.t_maxseg]
or [temp_bits], TCP_BIT_SENDALOT
.no_overflow: