Date: Wed, 10 Sep 2008 01:13:33 +0100 From: "Bruce M. Simpson" <bms@FreeBSD.org> To: FreeBSD-Net mailing list <freebsd-net@freebsd.org> Subject: Re: Problem with IFDATA_DRIVERNAME sysctl Message-ID: <48C7112D.3070309@FreeBSD.org> In-Reply-To: <48C70743.1020003@incunabulum.net> References: <48C70743.1020003@incunabulum.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Bruce M Simpson wrote:
>
> It looks like the switch..case in that path could be fubar'd by the
> compiler as there are not break statements for each distinct case
> label, could this be due to gcc friendly fire?
Possibly false alarm or PEBKAC, I wasn't checking return values right in
some of my code, although we should probably have "break" there anyway.
Patch against RELENG_7_0.
[-- Attachment #2 --]
--- 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;
case IFDATA_GENERAL:
bzero(&ifmd, sizeof(ifmd));
@@ -136,6 +137,7 @@
error = SYSCTL_IN(req, ifp->if_linkmib, ifp->if_linkmiblen);
if (error)
return error;
+ break;
case IFDATA_DRIVERNAME:
/* 20 is enough for 64bit ints */
@@ -152,6 +154,7 @@
error = EPERM;
free(dbuf, M_TEMP);
return (error);
+ break;
}
return 0;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48C7112D.3070309>
