summaryrefslogtreecommitdiffstats
path: root/sys/net/if_stf.c
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2007-09-23 17:50:17 +0000
committercsjp <csjp@FreeBSD.org>2007-09-23 17:50:17 +0000
commit5328bd11db07bc15a5d7779bfc5f61f64128d0e2 (patch)
treecafe7b703267924743661ce30ee5878ae415f23c /sys/net/if_stf.c
parent9f9cc8d8af1e3d0faf3aa8f6c33dcba894d564c6 (diff)
downloadFreeBSD-src-5328bd11db07bc15a5d7779bfc5f61f64128d0e2.zip
FreeBSD-src-5328bd11db07bc15a5d7779bfc5f61f64128d0e2.tar.gz
Certain consumers of rtalloc like gif(4) and if_stf(4) lookup the
route and once they are done with it, call rtfree(). rtfree() should only be used when we are certain we hold the last reference to the route. This bug results in console messages like the following: rtfree: 0xc40f7000 has 1 refs This patch switches the rtfree() to use RTFREE_LOCKED() instead, which should handle the reference counting on the route better. Approved by: re@ (gnn) Reviewed by: bms Reported by: many via net@ and current@ Tested by: many
Diffstat (limited to 'sys/net/if_stf.c')
-rw-r--r--sys/net/if_stf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 2f53c44..dfb9aea 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -607,10 +607,10 @@ stf_checkaddr4(sc, in, inifp)
(u_int32_t)ntohl(sin.sin_addr.s_addr));
#endif
if (rt)
- rtfree(rt);
+ RTFREE_LOCKED(rt);
return -1;
}
- rtfree(rt);
+ RTFREE_LOCKED(rt);
}
return 0;
OpenPOWER on IntegriCloud