Skip to content

Commit

Permalink
Avoid segfault of ifconfig(8) on missing /proc/net/dev
Browse files Browse the repository at this point in the history
(Debian Bug #222209 Pierre Lombard, Tollef Fog Heen)
  • Loading branch information
Bernd Eckenfels committed Oct 2, 2008
1 parent 0009712 commit 188a83f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ifconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, <[email protected]>
* and others. Copyright 1993 MicroWalt Corporation
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 188a83f

Please sign in to comment.