route: Remove ref counting around rt_newaddrmsg().
authorRoy Marples <roy@marples.name>
Tue, 20 Aug 2019 13:18:51 +0000 (14:18 +0100)
committerRoy Marples <roy@marples.name>
Tue, 20 Aug 2019 13:18:51 +0000 (14:18 +0100)
Doesn't seem to be needed anymore.
As proposed by sephe.

sys/net/route.c
sys/netinet6/in6.c

index fbce93f..e2e007b 100644 (file)
@@ -1577,11 +1577,8 @@ rtinit_rtrequest_callback(int cmd, int error,
        struct ifaddr *ifa = arg;
 
        if (error == 0 && rt) {
-               if (mycpuid == 0) {
-                       ++rt->rt_refcnt;
+               if (mycpuid == 0)
                        rt_newaddrmsg(cmd, ifa, error, rt);
-                       --rt->rt_refcnt;
-               }
                if (cmd == RTM_DELETE) {
                        if (rt->rt_refcnt == 0) {
                                ++rt->rt_refcnt;
index c1152ed..54da554 100644 (file)
@@ -240,11 +240,8 @@ in6_newaddrmsg_callback(int cmd, int error, struct rt_addrinfo *rtinfo,
 {
        struct ifaddr *ifa = arg;
 
-       if (error == 0 && rt != NULL && mycpuid == 0) {
-               ++rt->rt_refcnt;
+       if (error == 0 && rt != NULL && mycpuid == 0)
                rt_newaddrmsg(RTM_ADD, ifa, error, rt);
-               --rt->rt_refcnt;
-       }
 }
 
 void