diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-06-21 17:11:44 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-06-21 17:11:44 +0000 |
commit | fb482f64f911b7fca87d82ac917a331783e5915c (patch) | |
tree | 5de16192a2d5c2016a8f06548095348d71e6ebdf /sys/net/route.h | |
parent | d54cd84095c832ef5111a5e80e44ec90ec860873 (diff) |
Prevent recursions by not deleting entries inside rtable_walk(9).
rtable_walk(9) now passes a routing entry back to the caller when
a non zero value is returned and if it asked for it.
This allows us to call rtdeletemsg()/rtrequest_delete() from the
caller without creating a recursion because of rtflushclone().
Multicast code hasn't been adapted and is still possibly creating
recursions. However multicast route entries aren't cloned so if
a recursion exists it isn't because of rtflushclone().
Fix stack exhaustion triggered by the use of "-msave-args".
Issue reported by Dániel Lévai on bugs@ confirmed by and ok bluhm@.
Diffstat (limited to 'sys/net/route.h')
-rw-r--r-- | sys/net/route.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/route.h b/sys/net/route.h index 93ed426607c..f116002d058 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $OpenBSD: route.h,v 1.175 2019/04/28 17:59:51 mpi Exp $ */ +/* $OpenBSD: route.h,v 1.176 2019/06/21 17:11:42 mpi Exp $ */ /* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */ /* @@ -451,7 +451,7 @@ void rtfree(struct rtentry *); int rt_ifa_add(struct ifaddr *, int, struct sockaddr *, unsigned int); int rt_ifa_del(struct ifaddr *, int, struct sockaddr *, unsigned int); -void rt_ifa_purge(struct ifaddr *); +int rt_ifa_purge(struct ifaddr *); int rt_ifa_addlocal(struct ifaddr *); int rt_ifa_dellocal(struct ifaddr *); void rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, struct rtentry **, unsigned int); @@ -459,7 +459,7 @@ int rtrequest(int, struct rt_addrinfo *, u_int8_t, struct rtentry **, u_int); int rtrequest_delete(struct rt_addrinfo *, u_int8_t, struct ifnet *, struct rtentry **, u_int); -void rt_if_track(struct ifnet *); +int rt_if_track(struct ifnet *); int rt_if_linkstate_change(struct rtentry *, void *, u_int); int rtdeletemsg(struct rtentry *, struct ifnet *, u_int); #endif /* _KERNEL */ |