Skip to content

Commit c0bef38

Browse files
author
Ian Seyler
committed
Fix b_net_rx logic
1 parent 33b1cb1 commit c0bef38

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/syscalls/net.asm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ b_net_tx_fail:
100100
b_net_rx:
101101
push rdx
102102

103+
mov cl, byte [os_net_icount] ; Get interface count
104+
cmp cl, 0
105+
je b_net_rx_end ; Bail out if there are no valid interfaces
106+
dec cl ; Interfaces start at 0
107+
cmp cl, dl
103108
xor ecx, ecx
104-
105-
cmp byte [os_net_icount], dl ; Check if interface is valid
106-
ja b_net_rx_end
109+
ja b_net_rx_end ; Bail out if it was an invalid interface
107110

108111
shl edx, 7 ; Quick multiply by 128
109112
add edx, net_table ; Add offset to net_table

0 commit comments

Comments
 (0)