From bf256341b97891722230b613488b35648de68f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 4 Apr 2007 14:20:32 +0000 Subject: [PATCH] Only print the media state in case we're linked. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20557 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/network/ifconfig/ifconfig.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/network/ifconfig/ifconfig.cpp b/src/bin/network/ifconfig/ifconfig.cpp index 73b6698cd2..0e4a36f1f2 100644 --- a/src/bin/network/ifconfig/ifconfig.cpp +++ b/src/bin/network/ifconfig/ifconfig.cpp @@ -214,7 +214,9 @@ list_interface(int socket, const char* name) close(linkSocket); } - if (ioctl(socket, SIOCGIFMEDIA, &request, sizeof(struct ifreq)) == 0) { + if (ioctl(socket, SIOCGIFMEDIA, &request, sizeof(struct ifreq)) == 0 + && (request.ifr_media & IFM_ACTIVE) != 0) { + // dump media state in case we're linked const char* type = "unknown"; bool show = true;