From 0848e23fb4248d739252cda3a39b72045e7a6f7d Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Mon, 9 Nov 2015 10:26:27 +0000 Subject: 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 --- sys/net/rtsock.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/net/rtsock.c') 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) { -- cgit v1.2.3