From b10b3f997d969111c6e680c6d0b44ebfab874aab Mon Sep 17 00:00:00 2001 From: mpi Date: Wed, 14 Oct 2015 10:18:03 +0000 Subject: [PATCH] Reset the RTF_CONNECTED flag when cloning an entry. While here check for RTF_CLONED insted of RTM_RESOLVE when adding an entry. Found while debugging naddy@'s NFS vs em(4) vs rtisvalid(9) issue. --- sys/net/route.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index fcf62811f6f..f9955761686 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.251 2015/10/14 10:09:30 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.252 2015/10/14 10:18:03 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -806,10 +806,9 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, info->rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; } - info->rti_flags = rt->rt_flags & ~(RTF_CLONING | RTF_STATIC); - info->rti_flags |= RTF_CLONED; + info->rti_flags = rt->rt_flags | (RTF_CLONED|RTF_HOST); + info->rti_flags &= ~(RTF_CLONING|RTF_CONNECTED|RTF_STATIC); info->rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sa_dl; - info->rti_flags |= RTF_HOST; info->rti_info[RTAX_LABEL] = rtlabel_id2sa(rt->rt_labelid, &sa_rl2); /* FALLTHROUGH */ @@ -905,7 +904,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, ifa->ifa_refcnt++; rt->rt_ifa = ifa; rt->rt_ifp = ifa->ifa_ifp; - if (req == RTM_RESOLVE) { + if (rt->rt_flags & RTF_CLONED) { /* * If the ifa of the cloning route was stale, a * successful lookup for an ifa with the same address -- 2.20.1