diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-11-09 10:26:27 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-11-09 10:26:27 +0000 |
commit | 0848e23fb4248d739252cda3a39b72045e7a6f7d (patch) | |
tree | c632b6a0490eb0c96161475b1202058765b6e6e4 /sys/net/route.h | |
parent | 65d519d33fdf28af8a71ba6fc434b4e04fcdb207 (diff) |
Rewrite rtalloc(9) to consider RTF_GATEWAY entries without valid next-
hop route as invalid.
Previously when such entrie was returned by rtalloc(9) a second route
lookup was done in rt_checkgate() very late in the journey of a packet.
In other words a single rtalloc(9) call can now result in multiple
route lookups if a RTF_GATEWAY entry is returned.
This is a step towards always calling L2 output functions with valid
destination information.
Tested by various including jmc@, naddy@, Hrvoje Popovski
Diffstat (limited to 'sys/net/route.h')
-rw-r--r-- | sys/net/route.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/route.h b/sys/net/route.h index accaba02bed..0d79922dd97 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $OpenBSD: route.h,v 1.120 2015/11/06 17:55:55 mpi Exp $ */ +/* $OpenBSD: route.h,v 1.121 2015/11/09 10:26:26 mpi Exp $ */ /* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */ /* @@ -119,6 +119,8 @@ struct rtentry { }; #define rt_use rt_rmx.rmx_pksent #define rt_expire rt_rmx.rmx_expire +#define rt_locks rt_rmx.rmx_locks +#define rt_mtu rt_rmx.rmx_mtu #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ @@ -358,7 +360,7 @@ void rt_maskedcopy(struct sockaddr *, void rt_sendmsg(struct rtentry *, int, u_int); void rt_sendaddrmsg(struct rtentry *, int); void rt_missmsg(int, struct rt_addrinfo *, int, u_int, int, u_int); -int rt_setgate(struct rtentry *, struct sockaddr *, unsigned int); +int rt_setgate(struct rtentry *, struct sockaddr *); int rt_checkgate(struct ifnet *, struct rtentry *, struct sockaddr *, unsigned int, struct rtentry **); void rt_setmetrics(u_long, struct rt_metrics *, struct rt_kmetrics *); |