From 55e07c34a2e33e31d381c6dbb8b7c33e7163affa Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 18 Mar 1997 00:37:34 +0000 Subject: [PATCH] Ignore E2BIG in domediaopt() like we do in setmedia(). Oversight pointed out by Andrew Gallatin . --- sbin/ifconfig/ifconfig.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 1c84173f67aa..fbc8c4cbd3e8 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.24 1997/03/17 03:08:48 thorpej Exp $ */ +/* $NetBSD: ifconfig.c,v 1.25 1997/03/18 00:37:34 thorpej Exp $ */ /* * Copyright (c) 1997 Jason R. Thorpe. @@ -75,7 +75,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.24 1997/03/17 03:08:48 thorpej Exp $"; +static char rcsid[] = "$NetBSD: ifconfig.c,v 1.25 1997/03/18 00:37:34 thorpej Exp $"; #endif #endif /* not lint */ @@ -630,8 +630,14 @@ domediaopt(val, clear) ifmr.ifm_count = 1; ifmr.ifm_ulist = &first_type; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) - err(1, "SIOCGIFMEDIA"); + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + /* + * If we get E2BIG, the kernel is telling us + * that there are more, so we can ignore it. + */ + if (errno != E2BIG) + err(1, "SIOCGIFMEDIA"); + } if (ifmr.ifm_count == 0) errx(1, "%s: no media types?", name);