From 8cb7f8f861c9df1ebd8fcc67a4c640acd6d8149e Mon Sep 17 00:00:00 2001 From: Qing Li Date: Sun, 20 Sep 2009 17:46:56 +0000 Subject: [PATCH] MFC r197364 A wrong variable is used when setting up the interface address route, which broke source address selection in some code paths. Submitted by: noted by bz Reviewed by: hrs Approved by: re (kib) --- sys/net/if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index c0ff443d6dc..55de666a636 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1432,9 +1432,9 @@ ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) if (error == 0 && rt != NULL) { RT_LOCK(rt); ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; + ifa->ifa_ifp->if_type; ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; + ifa->ifa_ifp->if_index; RT_REMREF(rt); RT_UNLOCK(rt); } else if (error != 0)