aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>2000-04-21 17:48:48 +0000
committerGuido van Rooij <guido@FreeBSD.org>2000-04-21 17:48:48 +0000
commitd91a068efb80508778efd92ed95178bae79f4bf4 (patch)
tree4c6174dd4a9f643870e642df3f308131a16eea5d /sys/net/if.c
parent4e618aafa1c3cf29776c8523dbf58faa1123aeef (diff)
downloadsrc-d91a068efb80508778efd92ed95178bae79f4bf4.tar.gz
src-d91a068efb80508778efd92ed95178bae79f4bf4.zip
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>
Notes
Notes: svn path=/head/; revision=59468
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 6c105b68647c..c328575bfd26 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);
}