summaryrefslogtreecommitdiff
path: root/Userland/ifconfig.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-28 07:12:05 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-28 14:14:26 +0100
commit75ed262fe5153432bcf7ac4a1e36cf0c3008c210 (patch)
treeb7e1ac93650f7f6c5881a9f2c653df6c323f084c /Userland/ifconfig.cpp
parent70fadbad37676500037a45778f6480399dc07623 (diff)
downloadserenity-75ed262fe5153432bcf7ac4a1e36cf0c3008c210.zip
Kernel+ifconfig: Add an MTU value to NetworkAdapter
This defaults to 1500 for all adapters, but LoopbackAdapter increases it to 65536 on construction. If an IPv4 packet is larger than the MTU, we'll need to break it into smaller fragments before transmitting it. This part is a FIXME. :^)
Diffstat (limited to 'Userland/ifconfig.cpp')
-rw-r--r--Userland/ifconfig.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/ifconfig.cpp b/Userland/ifconfig.cpp
index 48f32e184e..a67b7e1cf1 100644
--- a/Userland/ifconfig.cpp
+++ b/Userland/ifconfig.cpp
@@ -70,6 +70,7 @@ int main(int argc, char** argv)
auto bytes_in = if_object.get("bytes_in").to_u32();
auto packets_out = if_object.get("packets_out").to_u32();
auto bytes_out = if_object.get("bytes_out").to_u32();
+ auto mtu = if_object.get("mtu").to_u32();
printf("%s:\n", name.characters());
printf(" mac: %s\n", mac_address.characters());
@@ -77,6 +78,7 @@ int main(int argc, char** argv)
printf(" class: %s\n", class_name.characters());
printf(" RX: %u packets %u bytes (%s)\n", packets_in, bytes_in, si_bytes(bytes_in).characters());
printf(" TX: %u packets %u bytes (%s)\n", packets_out, bytes_out, si_bytes(bytes_out).characters());
+ printf(" MTU: %u\n", mtu);
printf("\n");
});