summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-11-20 13:12:15 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-11-20 13:12:15 +0000
commitd7acef020645a562758e1101f4e56a95957cff06 (patch)
tree42bb378387b32da43723d9e5f9ee001c47fc6f3a
parenta18ce28cc3afa4c9e8e42c6365587fda7bf7ad9f (diff)
Initialise the ifidx to 0 (no interface) in rtredirect() to avoid using
ifidx uninitialised for the gateway not directly reachable case. ok mpi@
-rw-r--r--sys/net/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index b0788ffea1c..abb00b7bc4f 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.274 2015/11/18 14:13:52 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.275 2015/11/20 13:12:14 jsg Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -536,7 +536,7 @@ rtredirect(struct sockaddr *dst, struct sockaddr *gateway,
u_int32_t *stat = NULL;
struct rt_addrinfo info;
struct ifaddr *ifa;
- unsigned int ifidx;
+ unsigned int ifidx = 0;
splsoftassert(IPL_SOFTNET);