From 4046d8c9d4556a4886bd3c7b44bf25772d4a1224 Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 21 Apr 2000 17:48:48 +0000 Subject: IOCGIFCONF once and for all. Sometimes the ifc_len variable would be returned with a wrong value. While we're here, get rid of unnecessary panic call. PR: 17311, 12996, 14457 Submitted by: Patrick Bihan-Faou , Kris Kennaway --- sys/net/if.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if.c b/sys/net/if.c index 6c105b6..c328575 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1086,11 +1086,10 @@ ifconf(cmd, data) sizeof (ifr)); ifrp++; } else { - if (space < sa->sa_len - sizeof(*sa)) + if (space < sizeof (ifr) + sa->sa_len - + sizeof(*sa)) break; space -= sa->sa_len - sizeof(*sa); - if (space < sizeof (ifr)) - break; error = copyout((caddr_t)&ifr, (caddr_t)ifrp, sizeof (ifr.ifr_name)); if (error == 0) @@ -1115,8 +1114,6 @@ ifconf(cmd, data) ifrp++; } } - if (space < 0) - panic("ifconf: space < 0"); ifc->ifc_len -= space; return (error); } -- cgit v1.1