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/rtsock.c | |
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/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index cf4b9998d49..2bd5733b902 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.181 2015/11/02 14:40:09 mpi Exp $ */ +/* $OpenBSD: rtsock.c,v 1.182 2015/11/09 10:26:26 mpi Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -745,9 +745,8 @@ report: goto flush; ifa = info.rti_ifa; } - if (info.rti_info[RTAX_GATEWAY] != NULL && - (error = rt_setgate(rt, info.rti_info[RTAX_GATEWAY], - tableid))) + if (info.rti_info[RTAX_GATEWAY] != NULL && (error = + rt_setgate(rt, info.rti_info[RTAX_GATEWAY]))) goto flush; if (ifa) { if (rt->rt_ifa != ifa) { |