diff options
author | guido <guido@FreeBSD.org> | 2000-04-21 17:48:48 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 2000-04-21 17:48:48 +0000 |
commit | 4046d8c9d4556a4886bd3c7b44bf25772d4a1224 (patch) | |
tree | 82922f9866677a6680cd4a75412a353089eab4be /sys/net | |
parent | 3011fb4da98581ac0eae48fe265b828f62a3773c (diff) | |
download | FreeBSD-src-4046d8c9d4556a4886bd3c7b44bf25772d4a1224.zip FreeBSD-src-4046d8c9d4556a4886bd3c7b44bf25772d4a1224.tar.gz |
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 <patrick@mindstep.com>,
Kris Kennaway <kris@FreeBSD.org>
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 7 |
1 files changed, 2 insertions, 5 deletions
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); } |