summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorabs <abs@NetBSD.org>2012-06-25 17:25:29 +0000
committerabs <abs@NetBSD.org>2012-06-25 17:25:29 +0000
commit2e333d5e0a50fb8b68b2e2bf5b37eb2eb7df503c (patch)
tree7adf0c7eccb26657429365ec0f5d6be4c183bec1 /sys/netinet6
parent2da5882538064993b2c9e2ee0434fed9afa3f14d (diff)
Some fun in trying to work out what was broken with gcc-4.1 to
trigger the following warning when gcc-4.5 was silent: nd6_rtr.c: In function 'nd6_ra_input': nd6_rtr.c:788: warning: 'ext' may be used uninitialized in this function Eventually determined that it was not unreasonable for gcc-4.1 to bleat in this case as there is a nasty 'goto insert' which could indeed have resulted in an uninitialised variable use. Yay gcc 4.1.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6_rtr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index ff29a6d9e0b..75fb3309dbd 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6_rtr.c,v 1.83 2012/06/23 03:14:04 christos Exp $ */
+/* $NetBSD: nd6_rtr.c,v 1.84 2012/06/25 17:25:29 abs Exp $ */
/* $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.83 2012/06/23 03:14:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.84 2012/06/25 17:25:29 abs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -744,6 +744,7 @@ static struct nd_defrouter *
defrtrlist_update(struct nd_defrouter *new)
{
struct nd_defrouter *dr, *n;
+ struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6];
int s = splsoftnet();
if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) {
@@ -785,7 +786,6 @@ defrtrlist_update(struct nd_defrouter *new)
return (dr);
}
- struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6];
if (ip6_maxifdefrouters >= 0 &&
ext->ndefrouters >= ip6_maxifdefrouters) {
splx(s);