summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-01-06 17:46:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-01-06 17:46:37 +0000
commit6768d3cee2ba9abb42ef02adf85d67149f5e6939 (patch)
tree2953a18add1f15450ce26e30888d2d47da0c6ead
parent4022e0fe7645c5088b553871247ce41cda52f384 (diff)
from 4.4lite2; additional data from SIOCGIFCONF is at least sockaddr sized
-rw-r--r--sbin/ifconfig/ifconfig.88
-rw-r--r--sbin/ifconfig/ifconfig.c9
2 files changed, 11 insertions, 6 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 4b11a6ff9ee..d8de8a723a2 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: ifconfig.8,v 1.10 1995/03/18 14:56:23 cgd Exp $
+.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -31,9 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
+.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
.\"
-.Dd January 5, 1994
+.Dd June 1, 1994
.Dt IFCONFIG 8
.Os BSD 4.2
.Sh NAME
@@ -142,6 +142,7 @@ Enable driver dependent debugging code; usually, this turns on
extra console error logging.
.It Fl debug
Disable driver dependent debugging code.
+.ne 1i
.It Cm delete
Remove the network address specified.
This would be used if you incorrectly specified an alias, or it
@@ -244,6 +245,7 @@ they are in general used to select special modes of operation. An example
of this is to enable SLIP compression, or to select the connector type
for some ethernet cards. Refer to the man page for the specific driver
for more information.
+.ne 1i
.It Fl link[0-2]
Disable special processing at the link level with the specified interface.
.It Cm up
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 083568e85d9..3890ae21a81 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ifconfig.c,v 1.21 1995/10/08 23:03:54 gwr Exp $ */
+/* $NetBSD: ifconfig.c,v 1.22 1996/01/04 20:11:20 pk Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static char rcsid[] = "$NetBSD: ifconfig.c,v 1.21 1995/10/08 23:03:54 gwr Exp $";
+static char rcsid[] = "$NetBSD: ifconfig.c,v 1.22 1996/01/04 20:11:20 pk Exp $";
#endif
#endif /* not lint */
@@ -333,7 +333,10 @@ printall()
ifreq.ifr_name[0] = '\0';
for (i = 0; i < ifc.ifc_len; ) {
ifr = (struct ifreq *)((caddr_t)ifc.ifc_req + i);
- i += sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len;
+ i += sizeof(ifr->ifr_name) +
+ (ifr->ifr_addr.sa_len > sizeof(struct sockaddr)
+ ? ifr->ifr_addr.sa_len
+ : sizeof(struct sockaddr));
if (!strncmp(ifreq.ifr_name, ifr->ifr_name,
sizeof(ifr->ifr_name)))
continue;