From cd411eab909c7edcfb80587825adca378ab09c4e Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 19 Dec 2014 22:55:47 +0000 Subject: [PATCH] netstat: show first network adapter by default, if available. (skip loopback) git-svn-id: svn://kolibrios.org@5250 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/netstat/netstat.asm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/programs/network/netstat/netstat.asm b/programs/network/netstat/netstat.asm index 0ee8a558ad..727f522cae 100644 --- a/programs/network/netstat/netstat.asm +++ b/programs/network/netstat/netstat.asm @@ -767,6 +767,10 @@ draw_interfaces: mov ecx, eax dec al mov [last_device], al + cmp [device], al + jbe @f + mov [device], 0 + @@: xor ebx, ebx ; get device type .loop: @@ -815,11 +819,11 @@ draw_interfaces: ; DATA AREA name db 'Network status', 0 -mode dw 101 -device db 0 -last_device db 0 -device_type dd 0 -last dd 0 +mode dw 101 ; currently selected protocol +device db 1 ; currently selected device +last_device db ? ; last device available +device_type dd ? +last dd ? modes db 'Physical IPv4 ARP ICMP UDP TCP', 0 str_packets_tx db 'Packets sent:', 0