Diff below kills the macro and use the fonction instead since they are
equivalent.  It also replaces some 0 -> NULL where it applies.  It does
not include the manpage bits, I'll deal with that afterward.

I'd appreciate reviews and oks.

Index: net/if_gre.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_gre.c,v
retrieving revision 1.70
diff -u -p -r1.70 if_gre.c
--- net/if_gre.c        22 Jul 2014 11:06:09 -0000      1.70
+++ net/if_gre.c        8 Oct 2014 10:20:33 -0000
@@ -519,8 +519,10 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 recompute:
                if ((sc->g_src.s_addr != INADDR_ANY) &&
                    (sc->g_dst.s_addr != INADDR_ANY)) {
-                       if (sc->route.ro_rt != 0)
-                               RTFREE(sc->route.ro_rt);
+                       if (sc->route.ro_rt != NULL) {
+                               rtfree(sc->route.ro_rt);
+                               sc->route.ro_rt = NULL;
+                       }
                        /* ip_output() will do the lookup */
                        bzero(&sc->route, sizeof(sc->route));
                        ifp->if_flags |= IFF_UP;
Index: net/if_mpe.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_mpe.c,v
retrieving revision 1.36
diff -u -p -r1.36 if_mpe.c
--- net/if_mpe.c        7 Oct 2014 08:59:50 -0000       1.36
+++ net/if_mpe.c        8 Oct 2014 10:20:33 -0000
@@ -186,7 +186,7 @@ mpestart(struct ifnet *ifp)
                sa->sa_family = AF_MPLS;
 
                mpls_output(rt->rt_ifp, m, sa, rt);
-               RTFREE(rt);
+               rtfree(rt);
        }
 }
 
Index: net/pf.c
===================================================================
RCS file: /home/ncvs/src/sys/net/pf.c,v
retrieving revision 1.888
diff -u -p -r1.888 pf.c
--- net/pf.c    8 Oct 2014 07:37:01 -0000       1.888
+++ net/pf.c    8 Oct 2014 10:20:33 -0000
@@ -2992,7 +2992,7 @@ pf_calc_mss(struct pf_addr *addr, sa_fam
        if (rt && rt->rt_ifp) {
                mss = rt->rt_ifp->if_mtu - hlen - sizeof(struct tcphdr);
                mss = max(tcp_mssdflt, mss);
-               RTFREE(rt);
+               rtfree(rt);
        }
        mss = min(mss, offer);
        mss = max(mss, 64);             /* sanity - at least max opt space */
@@ -5467,7 +5467,7 @@ pf_routable(struct pf_addr *addr, sa_fam
                ret = 0;
 out:
        if (ro.ro_rt != NULL)
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        return (ret);
 }
 
@@ -5511,7 +5511,7 @@ pf_rtlabel_match(struct pf_addr *addr, s
        if (ro.ro_rt != NULL) {
                if (ro.ro_rt->rt_labelid == aw->v.rtlabel)
                        ret = 1;
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        }
 
        return (ret);
@@ -5688,7 +5688,7 @@ done:
        if (r->rt != PF_DUPTO)
                *m = NULL;
        if (ro == &iproute && ro->ro_rt)
-               RTFREE(ro->ro_rt);
+               rtfree(ro->ro_rt);
        return;
 
 bad:
Index: net/pfkeyv2.c
===================================================================
RCS file: /home/ncvs/src/sys/net/pfkeyv2.c,v
retrieving revision 1.134
diff -u -p -r1.134 pfkeyv2.c
--- net/pfkeyv2.c       27 Sep 2014 12:26:16 -0000      1.134
+++ net/pfkeyv2.c       8 Oct 2014 10:20:33 -0000
@@ -1573,7 +1573,7 @@ pfkeyv2_send(struct socket *socket, void
                    re.re_tableid);
                if (re.re_rt != NULL) {
                        ipo = ((struct sockaddr_encap *) 
re.re_rt->rt_gateway)->sen_ipsp;
-                       RTFREE(re.re_rt);
+                       rtfree(re.re_rt);
 
                        /* Verify that the entry is identical */
                        if (bcmp(&ipo->ipo_addr, &encapdst,
Index: net/route.c
===================================================================
RCS file: /home/ncvs/src/sys/net/route.c,v
retrieving revision 1.186
diff -u -p -r1.186 route.c
--- net/route.c 8 Oct 2014 07:37:02 -0000       1.186
+++ net/route.c 8 Oct 2014 10:20:33 -0000
@@ -368,8 +368,7 @@ rtfree(struct rtentry *rt)
 {
        struct ifaddr   *ifa;
 
-       if (rt == NULL)
-               panic("rtfree");
+       KASSERT(rt != NULL);
 
        rt->rt_refcnt--;
 
@@ -788,8 +787,8 @@ rtrequest1(int req, struct rt_addrinfo *
                        panic ("rtrequest delete");
 
                if (rt->rt_gwroute) {
-                       rt = rt->rt_gwroute; RTFREE(rt);
-                       (rt = (struct rtentry *)rn)->rt_gwroute = NULL;
+                       rtfree(rt->rt_gwroute);
+                       rt->rt_gwroute = NULL;
                }
 
                if (rt->rt_parent) {
@@ -971,7 +970,7 @@ rtrequest1(int req, struct rt_addrinfo *
                                    (caddr_t)info->rti_info[RTAX_NETMASK],
                                    rnh, rt->rt_nodes, rt->rt_priority);
                        }
-                       RTFREE(crt);
+                       rtfree(crt);
                }
                if (rn == 0) {
                        ifafree(ifa);
@@ -1028,7 +1027,7 @@ rt_setgate(struct rtentry *rt, struct so
                free(old, M_RTABLE, 0);
        }
        if (rt->rt_gwroute != NULL) {
-               RTFREE(rt->rt_gwroute);
+               rtfree(rt->rt_gwroute);
                rt->rt_gwroute = NULL;
        }
        if (rt->rt_flags & RTF_GATEWAY) {
Index: net/route.h
===================================================================
RCS file: /home/ncvs/src/sys/net/route.h,v
retrieving revision 1.98
diff -u -p -r1.98 route.h
--- net/route.h 8 Oct 2014 07:37:02 -0000       1.98
+++ net/route.h 8 Oct 2014 10:20:33 -0000
@@ -330,13 +330,6 @@ u_int16_t   rtlabel_name2id(char *);
 struct sockaddr        *rtlabel_id2sa(u_int16_t, struct sockaddr_rtlabel *);
 void            rtlabel_unref(u_int16_t);
 
-#define        RTFREE(rt) do {                                                 
\
-       if ((rt)->rt_refcnt <= 1)                                       \
-               rtfree(rt);                                             \
-       else                                                            \
-               (rt)->rt_refcnt--;                                      \
-} while (/* CONSTCOND */0)
-
 /*
  * Values for additional argument to rtalloc1()
  */
Index: netinet/in_pcb.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/in_pcb.c,v
retrieving revision 1.159
diff -u -p -r1.159 in_pcb.c
--- netinet/in_pcb.c    27 Sep 2014 12:26:16 -0000      1.159
+++ netinet/in_pcb.c    8 Oct 2014 10:20:33 -0000
@@ -742,7 +742,7 @@ in_pcbrtentry(struct inpcb *inp)
 
        /* check if route is still valid */
        if (ro->ro_rt && (ro->ro_rt->rt_flags & RTF_UP) == 0) {
-               RTFREE(ro->ro_rt);
+               rtfree(ro->ro_rt);
                ro->ro_rt = NULL;
        }
 
@@ -832,7 +832,7 @@ in_selectsrc(struct in_addr **insrc, str
         */
        if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
            (satosin(&ro->ro_dst)->sin_addr.s_addr != sin->sin_addr.s_addr))) {
-               RTFREE(ro->ro_rt);
+               rtfree(ro->ro_rt);
                ro->ro_rt = NULL;
        }
        if ((ro->ro_rt == NULL || ro->ro_rt->rt_ifp == NULL)) {
Index: netinet/ip_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v
retrieving revision 1.237
diff -u -p -r1.237 ip_input.c
--- netinet/ip_input.c  30 Sep 2014 08:21:21 -0000      1.237
+++ netinet/ip_input.c  8 Oct 2014 10:20:33 -0000
@@ -964,8 +964,8 @@ ip_slowtimo(void)
                }
        }
        if (ipforward_rt.ro_rt) {
-               RTFREE(ipforward_rt.ro_rt);
-               ipforward_rt.ro_rt = 0;
+               rtfree(ipforward_rt.ro_rt);
+               ipforward_rt.ro_rt = NULL;
        }
        splx(s);
 }
@@ -1244,8 +1244,8 @@ ip_rtaddr(struct in_addr dst, u_int rtab
 
        if (ipforward_rt.ro_rt == 0 || dst.s_addr != sin->sin_addr.s_addr) {
                if (ipforward_rt.ro_rt) {
-                       RTFREE(ipforward_rt.ro_rt);
-                       ipforward_rt.ro_rt = 0;
+                       rtfree(ipforward_rt.ro_rt);
+                       ipforward_rt.ro_rt = NULL;
                }
                sin->sin_family = AF_INET;
                sin->sin_len = sizeof(*sin);
@@ -1418,12 +1418,12 @@ ip_forward(struct mbuf *m, struct ifnet 
        rtableid = m->m_pkthdr.ph_rtableid;
 
        sin = satosin(&ipforward_rt.ro_dst);
-       if ((rt = ipforward_rt.ro_rt) == 0 ||
+       if ((rt = ipforward_rt.ro_rt) == NULL ||
            ip->ip_dst.s_addr != sin->sin_addr.s_addr ||
            rtableid != ipforward_rt.ro_tableid) {
                if (ipforward_rt.ro_rt) {
-                       RTFREE(ipforward_rt.ro_rt);
-                       ipforward_rt.ro_rt = 0;
+                       rtfree(ipforward_rt.ro_rt);
+                       ipforward_rt.ro_rt = NULL;
                }
                sin->sin_family = AF_INET;
                sin->sin_len = sizeof(*sin);
@@ -1560,8 +1560,8 @@ ip_forward(struct mbuf *m, struct ifnet 
 #ifndef SMALL_KERNEL
        if (ipmultipath && ipforward_rt.ro_rt &&
            (ipforward_rt.ro_rt->rt_flags & RTF_MPATH)) {
-               RTFREE(ipforward_rt.ro_rt);
-               ipforward_rt.ro_rt = 0;
+               rtfree(ipforward_rt.ro_rt);
+               ipforward_rt.ro_rt = NULL;
        }
 #endif
        return;
Index: netinet/ip_output.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.268
diff -u -p -r1.268 ip_output.c
--- netinet/ip_output.c 8 Oct 2014 07:33:42 -0000       1.268
+++ netinet/ip_output.c 8 Oct 2014 10:20:33 -0000
@@ -177,8 +177,8 @@ ip_output(struct mbuf *m0, struct mbuf *
                if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
                    dst->sin_addr.s_addr != ip->ip_dst.s_addr ||
                    ro->ro_tableid != m->m_pkthdr.ph_rtableid)) {
-                       RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)0;
+                       rtfree(ro->ro_rt);
+                       ro->ro_rt = NULL;
                }
 
                if (ro->ro_rt == 0) {
@@ -328,8 +328,8 @@ reroute:
                if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
                    dst->sin_addr.s_addr != ip->ip_dst.s_addr ||
                    ro->ro_tableid != m->m_pkthdr.ph_rtableid)) {
-                       RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)0;
+                       rtfree(ro->ro_rt);
+                       ro->ro_rt = NULL;
                }
 
                if (ro->ro_rt == 0) {
@@ -582,7 +582,7 @@ sendit:
                        if (rt != NULL) {
                                rt->rt_rmx.rmx_mtu = icmp_mtu;
                                if (ro && ro->ro_rt != NULL) {
-                                       RTFREE(ro->ro_rt);
+                                       rtfree(ro->ro_rt);
                                        ro->ro_rt = rtalloc1(&ro->ro_dst, 
RT_REPORT,
                                            m->m_pkthdr.ph_rtableid);
                                }
@@ -717,7 +717,7 @@ sendit:
 
 done:
        if (ro == &iproute && ro->ro_rt)
-               RTFREE(ro->ro_rt);
+               rtfree(ro->ro_rt);
        return (error);
 bad:
 #ifdef IPSEC
Index: netinet/ip_spd.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_spd.c,v
retrieving revision 1.73
diff -u -p -r1.73 ip_spd.c
--- netinet/ip_spd.c    27 Sep 2014 12:26:16 -0000      1.73
+++ netinet/ip_spd.c    8 Oct 2014 10:20:33 -0000
@@ -260,14 +260,14 @@ ipsp_spd_lookup(struct mbuf *m, int af, 
        if ((re->re_rt->rt_gateway == NULL) ||
            (((struct sockaddr_encap *) re->re_rt->rt_gateway)->sen_type !=
                SENT_IPSP)) {
-               RTFREE(re->re_rt);
+               rtfree(re->re_rt);
                *error = EHOSTUNREACH;
                DPRINTF(("ip_spd_lookup: no gateway in SPD entry!"));
                return NULL;
        }
 
        ipo = ((struct sockaddr_encap *) (re->re_rt->rt_gateway))->sen_ipsp;
-       RTFREE(re->re_rt);
+       rtfree(re->re_rt);
        if (ipo == NULL) {
                *error = EHOSTUNREACH;
                DPRINTF(("ip_spd_lookup: no policy attached to SPD entry!"));
Index: netinet/tcp_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v
retrieving revision 1.278
diff -u -p -r1.278 tcp_input.c
--- netinet/tcp_input.c 22 Jul 2014 11:06:10 -0000      1.278
+++ netinet/tcp_input.c 8 Oct 2014 10:20:33 -0000
@@ -3375,8 +3375,10 @@ syn_cache_put(struct syn_cache *sc)
 {
        if (sc->sc_ipopts)
                (void) m_free(sc->sc_ipopts);
-       if (sc->sc_route4.ro_rt != NULL)
-               RTFREE(sc->sc_route4.ro_rt);
+       if (sc->sc_route4.ro_rt != NULL) {
+               rtfree(sc->sc_route4.ro_rt);
+               sc->sc_route4.ro_rt = NULL;
+       }
        timeout_set(&sc->sc_timer, syn_cache_reaper, sc);
        timeout_add(&sc->sc_timer, 0);
 }
Index: netinet6/frag6.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/frag6.c,v
retrieving revision 1.55
diff -u -p -r1.55 frag6.c
--- netinet6/frag6.c    27 Sep 2014 12:26:16 -0000      1.55
+++ netinet6/frag6.c    8 Oct 2014 10:20:33 -0000
@@ -200,7 +200,7 @@ frag6_input(struct mbuf **mp, int *offp,
        if (ro.ro_rt != NULL && ro.ro_rt->rt_ifa != NULL)
                dstifp = ifatoia6(ro.ro_rt->rt_ifa)->ia_ifp;
        if (ro.ro_rt != NULL) {
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
                ro.ro_rt = NULL;
        }
 #else
@@ -673,8 +673,8 @@ frag6_slowtimo(void)
         * destination and the cache is never replaced.
         */
        if (ip6_forward_rt.ro_rt) {
-               RTFREE(ip6_forward_rt.ro_rt);
-               ip6_forward_rt.ro_rt = 0;
+               rtfree(ip6_forward_rt.ro_rt);
+               ip6_forward_rt.ro_rt = NULL;
        }
 
        splx(s);
Index: netinet6/icmp6.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/icmp6.c,v
retrieving revision 1.148
diff -u -p -r1.148 icmp6.c
--- netinet6/icmp6.c    27 Aug 2014 14:04:16 -0000      1.148
+++ netinet6/icmp6.c    8 Oct 2014 10:20:33 -0000
@@ -1046,9 +1046,8 @@ icmp6_mtudisc_update(struct ip6ctlparam 
                        rt->rt_rmx.rmx_mtu = mtu;
                }
        }
-       if (rt) { /* XXX: need braces to avoid conflict with else in RTFREE. */
-               RTFREE(rt);
-       }
+       if (rt)
+               rtfree(rt);
 
        /*
         * Notify protocols that the MTU for this destination
@@ -1281,9 +1280,8 @@ icmp6_reflect(struct mbuf *m, size_t off
                bzero(&ro, sizeof(ro));
                error = in6_selectsrc(&src, &sa6_src, NULL, NULL, &ro, NULL,
                    m->m_pkthdr.ph_rtableid);
-               if (ro.ro_rt) { /* XXX: see comments in icmp6_mtudisc_update */
-                       RTFREE(ro.ro_rt); /* XXX: we could use this */
-               }
+               if (ro.ro_rt)
+                       rtfree(ro.ro_rt); /* XXX: we could use this */
                if (error) {
                        nd6log((LOG_DEBUG,
                            "icmp6_reflect: source can't be determined: "
@@ -1442,7 +1440,7 @@ icmp6_redirect_input(struct mbuf *m, int
                            "ICMP6 redirect rejected; no route "
                            "with inet6 gateway found for redirect dst: %s\n",
                            icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
-                       RTFREE(rt);
+                       rtfree(rt);
                        goto bad;
                }
 
@@ -1454,7 +1452,7 @@ icmp6_redirect_input(struct mbuf *m, int
                                "%s\n",
                                inet_ntop(AF_INET6, gw6, addr, sizeof(addr)),
                                icmp6_redirect_diag(&src6, &reddst6, 
&redtgt6)));
-                       RTFREE(rt);
+                       rtfree(rt);
                        goto bad;
                }
        } else {
@@ -1464,7 +1462,7 @@ icmp6_redirect_input(struct mbuf *m, int
                        icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
                goto bad;
        }
-       RTFREE(rt);
+       rtfree(rt);
        rt = NULL;
     }
 
Index: netinet6/in6.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/in6.c,v
retrieving revision 1.141
diff -u -p -r1.141 in6.c
--- netinet6/in6.c      7 Oct 2014 08:47:28 -0000       1.141
+++ netinet6/in6.c      8 Oct 2014 10:20:33 -0000
@@ -878,7 +878,7 @@ in6_update_ifa(struct ifnet *ifp, struct
                        if (memcmp(&mltaddr.sin6_addr,
                            &satosin6(rt_key(rt))->sin6_addr,
                            32 / 8)) {
-                               RTFREE(rt);
+                               rtfree(rt);
                                rt = NULL;
                        }
                }
@@ -897,7 +897,7 @@ in6_update_ifa(struct ifnet *ifp, struct
                        if (error)
                                goto cleanup;
                } else {
-                       RTFREE(rt);
+                       rtfree(rt);
                }
                imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error);
                if (!imm) {
@@ -947,7 +947,7 @@ in6_update_ifa(struct ifnet *ifp, struct
                        if (memcmp(&mltaddr.sin6_addr,
                            &satosin6(rt_key(rt))->sin6_addr,
                            32 / 8)) {
-                               RTFREE(rt);
+                               rtfree(rt);
                                rt = NULL;
                        }
                }
@@ -965,7 +965,7 @@ in6_update_ifa(struct ifnet *ifp, struct
                        if (error)
                                goto cleanup;
                } else {
-                       RTFREE(rt);
+                       rtfree(rt);
                }
                imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error);
                if (!imm) {
@@ -1620,11 +1620,11 @@ in6_ifpprefix(const struct ifnet *ifp, c
            rt->rt_ifp->if_carpdev != ifp->if_carpdev) &&
 #endif
            1)) {
-               RTFREE(rt);
+               rtfree(rt);
                return (0);
        }
 
-       RTFREE(rt);
+       rtfree(rt);
        return (1);
 }
 
Index: netinet6/in6_src.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/in6_src.c,v
retrieving revision 1.46
diff -u -p -r1.46 in6_src.c
--- netinet6/in6_src.c  27 Sep 2014 12:26:16 -0000      1.46
+++ netinet6/in6_src.c  8 Oct 2014 10:20:33 -0000
@@ -248,8 +248,8 @@ in6_selectsrc(struct in6_addr **in6src, 
        if (ro) {
                if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
                    !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst))) {
-                       RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)0;
+                       rtfree(ro->ro_rt);
+                       ro->ro_rt = NULL;
                }
                if (ro->ro_rt == (struct rtentry *)0 ||
                    ro->ro_rt->rt_ifp == (struct ifnet *)0) {
@@ -375,7 +375,7 @@ selectroute(struct sockaddr_in6 *dstsock
                    !IN6_ARE_ADDR_EQUAL(&ron->ro_dst.sin6_addr,
                    &sin6_next->sin6_addr)) {
                        if (ron->ro_rt) {
-                               RTFREE(ron->ro_rt);
+                               rtfree(ron->ro_rt);
                                ron->ro_rt = NULL;
                        }
                        ron->ro_dst = *sin6_next;
@@ -387,7 +387,7 @@ selectroute(struct sockaddr_in6 *dstsock
                        if (ron->ro_rt == NULL ||
                            (ron->ro_rt->rt_flags & RTF_GATEWAY)) {
                                if (ron->ro_rt) {
-                                       RTFREE(ron->ro_rt);
+                                       rtfree(ron->ro_rt);
                                        ron->ro_rt = NULL;
                                }
                                error = EHOSTUNREACH;
@@ -395,7 +395,7 @@ selectroute(struct sockaddr_in6 *dstsock
                        }
                }
                if (!nd6_is_addr_neighbor(sin6_next, ron->ro_rt->rt_ifp)) {
-                       RTFREE(ron->ro_rt);
+                       rtfree(ron->ro_rt);
                        ron->ro_rt = NULL;
                        error = EHOSTUNREACH;
                        goto done;
@@ -421,7 +421,7 @@ selectroute(struct sockaddr_in6 *dstsock
                    (!(ro->ro_rt->rt_flags & RTF_UP) ||
                     sin6tosa(&ro->ro_dst)->sa_family != AF_INET6 ||
                     !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst))) {
-                       RTFREE(ro->ro_rt);
+                       rtfree(ro->ro_rt);
                        ro->ro_rt = NULL;
                }
                if (ro->ro_rt == NULL) {
@@ -449,7 +449,7 @@ selectroute(struct sockaddr_in6 *dstsock
                        ifp = ro->ro_rt->rt_ifp;
 
                        if (ifp == NULL) { /* can this really happen? */
-                               RTFREE(ro->ro_rt);
+                               rtfree(ro->ro_rt);
                                ro->ro_rt = NULL;
                        }
                }
Index: netinet6/ip6_forward.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_forward.c,v
retrieving revision 1.68
diff -u -p -r1.68 ip6_forward.c
--- netinet6/ip6_forward.c      27 Sep 2014 12:26:16 -0000      1.68
+++ netinet6/ip6_forward.c      8 Oct 2014 10:20:33 -0000
@@ -245,8 +245,8 @@ reroute:
                    (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) == 0 ||
                    ip6_forward_rt.ro_tableid != rtableid) {
                        if (ip6_forward_rt.ro_rt) {
-                               RTFREE(ip6_forward_rt.ro_rt);
-                               ip6_forward_rt.ro_rt = 0;
+                               rtfree(ip6_forward_rt.ro_rt);
+                               ip6_forward_rt.ro_rt = NULL;
                        }
                        /* this probably fails but give it a try again */
                        ip6_forward_rt.ro_tableid = rtableid;
@@ -271,8 +271,8 @@ reroute:
           !IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &dst->sin6_addr) ||
           ip6_forward_rt.ro_tableid != rtableid) {
                if (ip6_forward_rt.ro_rt) {
-                       RTFREE(ip6_forward_rt.ro_rt);
-                       ip6_forward_rt.ro_rt = 0;
+                       rtfree(ip6_forward_rt.ro_rt);
+                       ip6_forward_rt.ro_rt = NULL;
                }
                bzero(dst, sizeof(*dst));
                dst->sin6_len = sizeof(struct sockaddr_in6);
@@ -546,8 +546,8 @@ senderr:
 #ifndef SMALL_KERNEL
        if (ip6_multipath && ip6_forward_rt.ro_rt &&
            (ip6_forward_rt.ro_rt->rt_flags & RTF_MPATH)) {
-               RTFREE(ip6_forward_rt.ro_rt);
-               ip6_forward_rt.ro_rt = 0;
+               rtfree(ip6_forward_rt.ro_rt);
+               ip6_forward_rt.ro_rt = NULL;
        }
 #endif
        return;
Index: netinet6/ip6_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_input.c,v
retrieving revision 1.129
diff -u -p -r1.129 ip6_input.c
--- netinet6/ip6_input.c        27 Sep 2014 12:26:16 -0000      1.129
+++ netinet6/ip6_input.c        8 Oct 2014 10:20:33 -0000
@@ -439,8 +439,8 @@ ip6_input(struct mbuf *m)
                if (ip6_forward_rt.ro_rt) {
                        /* route is down or destination is different */
                        ip6stat.ip6s_forward_cachemiss++;
-                       RTFREE(ip6_forward_rt.ro_rt);
-                       ip6_forward_rt.ro_rt = 0;
+                       rtfree(ip6_forward_rt.ro_rt);
+                       ip6_forward_rt.ro_rt = NULL;
                }
 
                bzero(&ip6_forward_rt.ro_dst, sizeof(struct sockaddr_in6));
Index: netinet6/ip6_output.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_output.c,v
retrieving revision 1.159
diff -u -p -r1.159 ip6_output.c
--- netinet6/ip6_output.c       27 Sep 2014 12:26:16 -0000      1.159
+++ netinet6/ip6_output.c       8 Oct 2014 10:20:33 -0000
@@ -958,10 +958,10 @@ reroute:
                ip6stat.ip6s_fragmented++;
 
 done:
-       if (ro == &ip6route && ro->ro_rt) { /* brace necessary for RTFREE */
-               RTFREE(ro->ro_rt);
+       if (ro == &ip6route && ro->ro_rt) {
+               rtfree(ro->ro_rt);
        } else if (ro_pmtu == &ip6route && ro_pmtu->ro_rt) {
-               RTFREE(ro_pmtu->ro_rt);
+               rtfree(ro_pmtu->ro_rt);
        }
 
        return (error);
@@ -1219,7 +1219,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s
                if (ro_pmtu->ro_rt &&
                    ((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 ||
                     !IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) {
-                       RTFREE(ro_pmtu->ro_rt);
+                       rtfree(ro_pmtu->ro_rt);
                        ro_pmtu->ro_rt = NULL;
                }
                if (ro_pmtu->ro_rt == 0) {
@@ -2256,7 +2256,7 @@ ip6_clearpktopts(struct ip6_pktopts *pkt
                pktopt->ip6po_tclass = -1;
        if (optname == -1 || optname == IPV6_NEXTHOP) {
                if (pktopt->ip6po_nextroute.ro_rt) {
-                       RTFREE(pktopt->ip6po_nextroute.ro_rt);
+                       rtfree(pktopt->ip6po_nextroute.ro_rt);
                        pktopt->ip6po_nextroute.ro_rt = NULL;
                }
                if (pktopt->ip6po_nexthop)
@@ -2278,7 +2278,7 @@ ip6_clearpktopts(struct ip6_pktopts *pkt
                        free(pktopt->ip6po_rhinfo.ip6po_rhi_rthdr, M_IP6OPT, 0);
                pktopt->ip6po_rhinfo.ip6po_rhi_rthdr = NULL;
                if (pktopt->ip6po_route.ro_rt) {
-                       RTFREE(pktopt->ip6po_route.ro_rt);
+                       rtfree(pktopt->ip6po_route.ro_rt);
                        pktopt->ip6po_route.ro_rt = NULL;
                }
        }
Index: netinet6/nd6.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/nd6.c,v
retrieving revision 1.122
diff -u -p -r1.122 nd6.c
--- netinet6/nd6.c      25 Aug 2014 14:00:34 -0000      1.122
+++ netinet6/nd6.c      8 Oct 2014 10:20:33 -0000
@@ -664,8 +664,8 @@ nd6_lookup(struct in6_addr *addr6, int c
                 * interface route.
                 */
                if (create) {
-                       RTFREE(rt);
-                       rt = 0;
+                       rtfree(rt);
+                       rt = NULL;
                }
        }
        if (!rt) {
Index: netinet6/nd6_nbr.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/nd6_nbr.c,v
retrieving revision 1.80
diff -u -p -r1.80 nd6_nbr.c
--- netinet6/nd6_nbr.c  12 Jul 2014 18:44:23 -0000      1.80
+++ netinet6/nd6_nbr.c  8 Oct 2014 10:20:33 -0000
@@ -528,13 +528,13 @@ nd6_ns_output(struct ifnet *ifp, struct 
        icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]++;
 
        if (ro.ro_rt) {         /* we don't cache this route. */
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        }
        return;
 
   bad:
        if (ro.ro_rt) {
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        }
        m_freem(m);
        return;
@@ -1044,13 +1044,13 @@ nd6_na_output(struct ifnet *ifp, struct 
        icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]++;
 
        if (ro.ro_rt) {         /* we don't cache this route. */
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        }
        return;
 
   bad:
        if (ro.ro_rt) {
-               RTFREE(ro.ro_rt);
+               rtfree(ro.ro_rt);
        }
        m_freem(m);
        return;
Index: netmpls/mpls_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netmpls/mpls_input.c,v
retrieving revision 1.38
diff -u -p -r1.38 mpls_input.c
--- netmpls/mpls_input.c        22 Jul 2014 11:06:10 -0000      1.38
+++ netmpls/mpls_input.c        8 Oct 2014 10:20:33 -0000
@@ -325,7 +325,7 @@ do_v6:
                if (ifp != NULL && rt_mpls->mpls_operation != MPLS_OP_LOCAL)
                        break;
 
-               RTFREE(rt);
+               rtfree(rt);
                rt = NULL;
        }
 
@@ -355,7 +355,7 @@ do_v6:
        (*ifp->if_ll_output)(ifp, m, smplstosa(smpls), rt);
 done:
        if (rt)
-               RTFREE(rt);
+               rtfree(rt);
 }
 
 int
@@ -468,12 +468,12 @@ mpls_do_error(struct mbuf *m, int type, 
                         * less interface we need to find some other IP to
                         * use as source.
                         */
-                       RTFREE(rt);
+                       rtfree(rt);
                        m_freem(m);
                        return (NULL);
                }
                rt->rt_use++;
-               RTFREE(rt);
+               rtfree(rt);
                if (icmp_reflect(m, NULL, ia))
                        return (NULL);
 

Reply via email to