9eae87d0c8
rt_refcnt of rtentry was used in bad manners, for example, direct rt_refcnt++ and rt_refcnt-- outside route.c, "rt->rt_refcnt++; rtfree(rt);" idiom, and touching rt after rt->rt_refcnt--. These abuses seem to be needed because rt_refcnt manages only references between rtentry and doesn't take care of references during packet processing (IOW references from local variables). In order to reduce the above abuses, the latter cases should be counted by rt_refcnt as well as the former cases. This change improves consistency of use of rt_refcnt: - rtentry is always accessed with rt_refcnt incremented - rtentry's rt_refcnt is decremented after use (rtfree is always used instead of rt_refcnt--) - functions returning rtentry increment its rt_refcnt (and caller rtfree it) Note that rt_refcnt prevents rtentry from being freed but doesn't prevent rtentry from being updated. Toward MP-safe, we need to provide another protection for rtentry, e.g., locks. (Or introduce a better data structure allowing concurrent readers during updates.) |
||
---|---|---|
.. | ||
altq | ||
arch | ||
coda | ||
compat | ||
conf | ||
crypto | ||
ddb | ||
dev | ||
dist/pf | ||
external | ||
fs | ||
gdbscripts | ||
ipkdb | ||
kern | ||
lib | ||
miscfs | ||
modules | ||
net | ||
net80211 | ||
netatalk | ||
netbt | ||
netinet | ||
netinet6 | ||
netipsec | ||
netisdn | ||
netkey | ||
netmpls | ||
netnatm | ||
netsmb | ||
nfs | ||
opencrypto | ||
rump | ||
secmodel | ||
stand | ||
sys | ||
ufs | ||
uvm | ||
Makefile |