I want to remove this chunked introduce in r7.19 in 1991 by sklower@
because it no longer makes any sense, it is a layer violation and
does no play well with rt refcounting.

When this chunk was introduced rtrequest1(RTM_DELETE...) was *not* doing
a route lookup.  So this check is now (and since a long time) redundant
with the rtable_lookup()+rtable_mpath_match() done inside rtrequest1(9).

Remember that when this code was introduced ``ifa'' where linked to
``rt'' in 1:1 fashion and rtrequest() started by rtfree(9)ing route
entries. That's why you wanted to be sure that the following line was
correct:

        error = rtrequest(cmd, dst, ifa->ifa_addr, ifa->ifa_netmask,
            flags | ifa->ifa_flags, &ifa->ifa_rt)

Ok?

Index: net/route.c
===================================================================
RCS file: /cvs/src/sys/net/route.c,v
retrieving revision 1.225
diff -u -p -r1.225 route.c
--- net/route.c 24 Aug 2015 22:11:33 -0000      1.225
+++ net/route.c 25 Aug 2015 10:43:32 -0000
@@ -1230,21 +1230,6 @@ rt_ifa_del(struct ifaddr *ifa, int flags
                rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
                dst = deldst;
        }
-       if ((rt = rtalloc(dst, 0, rtableid)) != NULL) {
-               rt->rt_refcnt--;
-#ifndef ART
-               /* try to find the right route */
-               while (rt && rt->rt_ifa != ifa)
-                       rt = (struct rtentry *)
-                           ((struct radix_node *)rt)->rn_dupedkey;
-               if (!rt) {
-                       if (m != NULL)
-                               (void) m_free(m);
-                       return (flags & RTF_HOST ? EHOSTUNREACH
-                                               : ENETUNREACH);
-               }
-#endif
-       }
 
        memset(&info, 0, sizeof(info));
        info.rti_ifa = ifa;

Reply via email to