aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-20 15:30:56 -0500
committerRob Landley <rob@landley.net>2016-10-20 15:30:56 -0500
commitd5e0ab8715eff1c16dedb3f60fa32c480153db69 (patch)
treecb77975fb7e7f04ed9a4cdbc06ae0bfe1a292199 /toys
parent817f059d48cf3e7bee267efd69cded04284494b4 (diff)
downloadtoybox-d5e0ab8715eff1c16dedb3f60fa32c480153db69.tar.gz
Show driver for interface in ifconfig output.
Diffstat (limited to 'toys')
-rw-r--r--toys/net/ifconfig.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/toys/net/ifconfig.c b/toys/net/ifconfig.c
index 1d2a41dc..174369fe 100644
--- a/toys/net/ifconfig.c
+++ b/toys/net/ifconfig.c
@@ -125,6 +125,9 @@ static void display_ifconfig(char *name, int always, unsigned long long val[])
xprintf("HWaddr ");
for (i=0; i<6; i++) xprintf(":%02x"+!i, ifre.ifr_hwaddr.sa_data[i]);
}
+ sprintf(toybuf, "/sys/class/net/%.15s/device/driver", name);
+ if (readlink0(toybuf, toybuf, sizeof(toybuf))>0 && (pp = strrchr(toybuf, '/')))
+ xprintf(" Driver %s", pp+1);
xputc('\n');
// If an address is assigned record that.