summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-11-08 23:36:32 +0000
committersam <sam@FreeBSD.org>2003-11-08 23:36:32 +0000
commitc997776d7c832608d60560c380ff43549d2dbe3a (patch)
tree216d7a328008c2857f9b286342d5087eea1cc6a5 /sys/netinet
parent1cd9ce158fbe3f8fd872eff74a1cfd939dea5515 (diff)
downloadFreeBSD-src-c997776d7c832608d60560c380ff43549d2dbe3a.zip
FreeBSD-src-c997776d7c832608d60560c380ff43549d2dbe3a.tar.gz
replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREF
macros that expand to include assertions when the system is built with INVARIANTS Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_atm.c2
-rw-r--r--sys/netinet/if_ether.c2
-rw-r--r--sys/netinet/ip_dummynet.c4
-rw-r--r--sys/netinet/ip_flow.c2
-rw-r--r--sys/netinet/ip_input.c2
5 files changed, 5 insertions, 7 deletions
diff --git a/sys/netinet/if_atm.c b/sys/netinet/if_atm.c
index 5a9e53e..b19502a 100644
--- a/sys/netinet/if_atm.c
+++ b/sys/netinet/if_atm.c
@@ -320,7 +320,7 @@ atmresolve(struct rtentry *rt, struct mbuf *m, struct sockaddr *dst,
rt = RTALLOC1(dst, 0);
if (rt == NULL)
goto bad; /* failed */
- rt->rt_refcnt--; /* don't keep LL references */
+ RT_REMREF(rt); /* don't keep LL references */
if ((rt->rt_flags & RTF_GATEWAY) != 0 ||
(rt->rt_flags & RTF_LLINFO) == 0 ||
/* XXX: are we using LLINFO? */
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index b6dafe7..c5238cf 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -954,7 +954,7 @@ arplookup(addr, create, proxy)
return (0);
#undef ISDYNCLONE
} else {
- rt->rt_refcnt--;
+ RT_REMREF(rt);
RT_UNLOCK(rt);
return ((struct llinfo_arp *)rt->rt_llinfo);
}
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index 3a9c99c..7a37677 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -1197,9 +1197,7 @@ dummynet_io(struct mbuf *m, int pipe_nr, int dir, struct ip_fw_args *fwa)
pkt->ro = *(fwa->ro);
if (pkt->ro.ro_rt) {
RT_LOCK(pkt->ro.ro_rt);
- pkt->ro.ro_rt->rt_refcnt++ ;
- KASSERT(pkt->ro.ro_rt->rt_refcnt > 0,
- ("bogus refcnt %ld", pkt->ro.ro_rt->rt_refcnt));
+ RT_ADDREF(pkt->ro.ro_rt) ;
RT_UNLOCK(pkt->ro.ro_rt);
}
if (fwa->dst == (struct sockaddr_in *)&fwa->ro->ro_dst) /* dst points into ro */
diff --git a/sys/netinet/ip_flow.c b/sys/netinet/ip_flow.c
index 25b8fce..a1e8743 100644
--- a/sys/netinet/ip_flow.c
+++ b/sys/netinet/ip_flow.c
@@ -353,7 +353,7 @@ ipflow_create(const struct route *ro, struct mbuf *m)
*/
ipf->ipf_ro = *ro;
RT_LOCK(ro->ro_rt);
- ro->ro_rt->rt_refcnt++;
+ RT_ADDREF(ro->ro_rt);
RT_UNLOCK(ro->ro_rt);
ipf->ipf_timer = IPFLOW_TIMER;
/*
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 2f2dc96..f09c477 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -237,7 +237,7 @@ static struct rtcache {
*(_ro) = ip_fwdcache.rc_ro; \
if ((rt = (_ro)->ro_rt) != NULL) { \
RT_LOCK(rt); \
- rt->rt_refcnt++; \
+ RT_ADDREF(rt); \
RT_UNLOCK(rt); \
} \
RTCACHE_UNLOCK(); \
OpenPOWER on IntegriCloud