From 3aa72005108497ea3364a1500b86e0ef167be9e8 Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Tue, 4 Feb 1997 03:14:35 +0000 Subject: [PATCH] Make sure we have arguments to pass before calling ifaof_ifpforaddr and ifa_ifwithroute. This eliminates the panic seen in kern/2647, although it doesn't address the fact that RTM_CHANGE can't change flags. --- sys/net/rtsock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index b6684c47e30f..a1fbc0d0185c 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -278,12 +278,12 @@ route_output(m, so) flags may also be different; ifp may be specified by ll sockaddr when protocol address is ambiguous */ if (ifpaddr && (ifa = ifa_ifwithnet(ifpaddr)) && - (ifp = ifa->ifa_ifp)) + (ifp = ifa->ifa_ifp) && (ifaaddr || gate)) ifa = ifaof_ifpforaddr(ifaaddr ? ifaaddr : gate, ifp); else if ((ifaaddr && (ifa = ifa_ifwithaddr(ifaaddr))) || - (ifa = ifa_ifwithroute(rt->rt_flags, - rt_key(rt), gate))) + (gate && (ifa = ifa_ifwithroute(rt->rt_flags, + rt_key(rt), gate)))) ifp = ifa->ifa_ifp; if (ifa) { register struct ifaddr *oifa = rt->rt_ifa;