diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-24 23:34:04 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-24 23:34:04 +0000 |
commit | 339997e7116567eb0703a2d90955c32977729226 (patch) | |
tree | 8443c2ab83636a38847d39500f9813090569bda0 | |
parent | 899b7d067750036bbeac46e1d4d8c4d71f2b2cba (diff) | |
download | FreeBSD-src-339997e7116567eb0703a2d90955c32977729226.zip FreeBSD-src-339997e7116567eb0703a2d90955c32977729226.tar.gz |
document the locking behaviour of the functions that access
the routing table.
-rw-r--r-- | sys/net/route.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/net/route.h b/sys/net/route.h index 4716789..b621d9b 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -324,10 +324,22 @@ void rt_ifmsg(struct ifnet *); void rt_missmsg(int, struct rt_addrinfo *, int, int); void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); void rt_newmaddrmsg(int, struct ifmultiaddr *); -void rtalloc(struct route *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); -void rtalloc_ign(struct route *, u_long); -/* NB: the rtentry is returned locked */ + +/* + * Note the following locking behavior: + * + * rtalloc_ign() and rtalloc() return ro->ro_rt unlocked + * + * rtalloc1() returns a locked rtentry + * + * rtfree() and RTFREE_LOCKED() require a locked rtentry + * + * RTFREE() uses an unlocked entry. + */ + +void rtalloc_ign(struct route *ro, u_long ignflags); +void rtalloc(struct route *ro); /* XXX deprecated, use rtalloc_ign(ro, 0) */ struct rtentry *rtalloc1(struct sockaddr *, int, u_long); int rtexpunge(struct rtentry *); void rtfree(struct rtentry *); |