Date: Tue, 9 Sep 2008 19:36:37 -0500 From: Brooks Davis <brooks@freebsd.org> To: "Bruce M. Simpson" <bms@freebsd.org> Cc: FreeBSD-Net mailing list <freebsd-net@freebsd.org> Subject: Re: Problem with IFDATA_DRIVERNAME sysctl Message-ID: <20080910003637.GB34060@lor.one-eyed-alien.net> In-Reply-To: <48C7112D.3070309@FreeBSD.org> References: <48C70743.1020003@incunabulum.net> <48C7112D.3070309@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080910003637.GB34060>