aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Eckenfels <net-tools@lina.inka.de>2008-10-02 23:31:04 +0000
committerBernd Eckenfels <net-tools@lina.inka.de>2008-10-02 23:31:04 +0000
commit188a83fae37ea872ad150527e330795d3cb83533 (patch)
treeeeb81adf8f04f345578668d92bc62d919b561a49
parentFix hypen in man pages (Debian Bug#288343 from Andrew Moise) (diff)
downloadnet-tools-188a83fae37ea872ad150527e330795d3cb83533.tar.gz
net-tools-188a83fae37ea872ad150527e330795d3cb83533.tar.bz2
net-tools-188a83fae37ea872ad150527e330795d3cb83533.zip
Avoid segfault of ifconfig(8) on missing /proc/net/dev
(Debian Bug #222209 Pierre Lombard, Tollef Fog Heen)
-rw-r--r--ifconfig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ifconfig.c b/ifconfig.c
index ac470b5..ab3f621 100644
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -3,7 +3,7 @@
* that either displays or sets the characteristics of
* one or more of the system's networking interfaces.
*
- * Version: $Id: ifconfig.c,v 1.57 2002/12/10 00:56:41 ecki Exp $
+ * Version: $Id: ifconfig.c,v 1.58 2008/10/02 23:31:04 ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
@@ -112,6 +112,9 @@ static int if_print(char *ifname)
struct interface *ife;
ife = lookup_interface(ifname);
+ if (!ife) {
+ return -1;
+ }
res = do_if_fetch(ife);
if (res >= 0)
ife_print(ife);