1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

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.
This commit is contained in:
Bill Fenner 1997-02-04 03:14:35 +00:00
parent 5237e118f1
commit 3aa7200510
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22250

View File

@ -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;