summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-06-26 09:00:50 +0000
committerru <ru@FreeBSD.org>2001-06-26 09:00:50 +0000
commite2738b93f296eb684c1000bcfa387fcc4d9b011d (patch)
tree7f6794f233b184c7148ad6b0385b2465c5685ab3 /sys/netinet
parent97e329557f7c5b7ded9ca22aa500a9456a09bb7c (diff)
downloadFreeBSD-src-e2738b93f296eb684c1000bcfa387fcc4d9b011d.zip
FreeBSD-src-e2738b93f296eb684c1000bcfa387fcc4d9b011d.tar.gz
Bring in fix from NetBSD's revision 1.16:
Pass the correct destination address for the route-to-gateway case. PR: kern/10607 MFC after: 2 weeks
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_flow.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_flow.c b/sys/netinet/ip_flow.c
index 6c9119b..a7af545 100644
--- a/sys/netinet/ip_flow.c
+++ b/sys/netinet/ip_flow.c
@@ -109,6 +109,7 @@ ipflow_fastforward(
struct ip *ip;
struct ipflow *ipf;
struct rtentry *rt;
+ struct sockaddr *dst;
int error;
/*
@@ -158,7 +159,12 @@ ipflow_fastforward(
*/
ipf->ipf_uses++;
ipf->ipf_timer = IPFLOW_TIMER;
- if ((error = (*rt->rt_ifp->if_output)(rt->rt_ifp, m, &ipf->ipf_ro.ro_dst, rt)) != 0) {
+
+ if (rt->rt_flags & RTF_GATEWAY)
+ dst = rt->rt_gateway;
+ else
+ dst = &ipf->ipf_ro.ro_dst;
+ if ((error = (*rt->rt_ifp->if_output)(rt->rt_ifp, m, dst, rt)) != 0) {
if (error == ENOBUFS)
ipf->ipf_dropped++;
else
OpenPOWER on IntegriCloud