From 682fe4822247e193d0cffdae3cc792c1037f9d57 Mon Sep 17 00:00:00 2001 From: Conrad Pankoff Date: Wed, 28 Aug 2019 11:01:16 +1000 Subject: Kernel: Show netmask/gateway in ProcFS when available --- Kernel/FileSystem/ProcFS.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Kernel') diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index e585ed2060..8651b784d3 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -319,7 +319,12 @@ Optional procfs$net_adapters(InodeIdentifier) obj.add("name", adapter.name()); obj.add("class_name", adapter.class_name()); obj.add("mac_address", adapter.mac_address().to_string()); - obj.add("ipv4_address", adapter.ipv4_address().to_string()); + if (!adapter.ipv4_address().is_zero()) { + obj.add("ipv4_address", adapter.ipv4_address().to_string()); + obj.add("ipv4_netmask", adapter.ipv4_netmask().to_string()); + } + if (!adapter.ipv4_gateway().is_zero()) + obj.add("ipv4_gateway", adapter.ipv4_gateway().to_string()); obj.add("packets_in", adapter.packets_in()); obj.add("bytes_in", adapter.bytes_in()); obj.add("packets_out", adapter.packets_out()); -- cgit v1.2.3