summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorConrad Pankoff <deoxxa@fknsrs.biz>2019-08-28 11:01:16 +1000
committerAndreas Kling <awesomekling@gmail.com>2019-08-29 06:25:06 +0200
commit682fe4822247e193d0cffdae3cc792c1037f9d57 (patch)
treeea9cdec87c249a263096745b4218fa5eb5a74b15 /Kernel
parent1aa7437ad7ef94516258a95d83ed31b7c5b99beb (diff)
downloadserenity-682fe4822247e193d0cffdae3cc792c1037f9d57.zip
Kernel: Show netmask/gateway in ProcFS when available
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp7
1 files changed, 6 insertions, 1 deletions
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<KBuffer> 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());