From owner-freebsd-net@FreeBSD.ORG  Wed Sep 10 00:35:47 2008
Return-Path: <owner-freebsd-net@FreeBSD.ORG>
Delivered-To: freebsd-net@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C16361065671;
	Wed, 10 Sep 2008 00:35:47 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net
	[IPv6:2001:4830:1200:a1::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A4FC8FC13;
	Wed, 10 Sep 2008 00:35:47 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (localhost [127.0.0.1])
	by lor.one-eyed-alien.net (8.14.3/8.14.2) with ESMTP id m8A0abwV035037; 
	Tue, 9 Sep 2008 19:36:37 -0500 (CDT)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: (from brooks@localhost)
	by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id m8A0abot035036;
	Tue, 9 Sep 2008 19:36:37 -0500 (CDT) (envelope-from brooks)
Date: Tue, 9 Sep 2008 19:36:37 -0500
From: Brooks Davis <brooks@freebsd.org>
To: "Bruce M. Simpson" <bms@freebsd.org>
Message-ID: <20080910003637.GB34060@lor.one-eyed-alien.net>
References: <48C70743.1020003@incunabulum.net> <48C7112D.3070309@FreeBSD.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="f2QGlHpHGjS2mn6Y"
Content-Disposition: inline
In-Reply-To: <48C7112D.3070309@FreeBSD.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(lor.one-eyed-alien.net [127.0.0.1]);
	Tue, 09 Sep 2008 19:36:37 -0500 (CDT)
Cc: FreeBSD-Net mailing list <freebsd-net@freebsd.org>
Subject: Re: Problem with IFDATA_DRIVERNAME sysctl
X-BeenThere: freebsd-net@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>,
	<mailto:freebsd-net-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net>
List-Post: <mailto:freebsd-net@freebsd.org>
List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>,
	<mailto:freebsd-net-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Sep 2008 00:35:47 -0000


--f2QGlHpHGjS2mn6Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 10, 2008 at 01:13:33AM +0100, Bruce M. Simpson wrote:
> Bruce M Simpson wrote:
>>=20
>> It looks like the switch..case in that path could be fubar'd by the=20
>> compiler as there are not break statements for each distinct case label,=
=20
>> could this be due to gcc friendly fire?
>=20
> Possibly false alarm or PEBKAC, I wasn't checking return values right in=
=20
> some of my code, although we should probably have "break" there anyway.
>=20
> Patch against RELENG_7_0.

> --- if_mib.c.orig	2008-09-10 00:31:25.000000000 +0100
> +++ if_mib.c	2008-09-10 00:32:15.000000000 +0100
> @@ -90,6 +90,7 @@
>  	switch(name[1]) {
>  	default:
>  		return ENOENT;
> +		break;

That's clearly a no-op since it's unreachable.

>  	case IFDATA_GENERAL:
>  		bzero(&ifmd, sizeof(ifmd));
> @@ -136,6 +137,7 @@
>  		error =3D SYSCTL_IN(req, ifp->if_linkmib, ifp->if_linkmiblen);
>  		if (error)
>  			return error;
> +		break;

This looks OK, but I haven't checked the context.

> =20
>  	case IFDATA_DRIVERNAME:
>  		/* 20 is enough for 64bit ints */
> @@ -152,6 +154,7 @@
>  			error =3D EPERM;
>  		free(dbuf, M_TEMP);
>  		return (error);
> +		break;

This is also a no-op.

--Brooks

>  	}
>  	return 0;
>  }

> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


--f2QGlHpHGjS2mn6Y
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iD8DBQFIxxaUXY6L6fI4GtQRAusjAJ9E3pmJoXXQjpeAXAkONcfiQb9f5ACeM9lZ
/s7Sqz/XJ4P+06XmZG7Qrng=
=Rt1N
-----END PGP SIGNATURE-----

--f2QGlHpHGjS2mn6Y--