Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet Pass the correct destination address for the rou...
details: https://anonhg.NetBSD.org/src/rev/06be2080bb52
branches: trunk
changeset: 494076:06be2080bb52
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri Jun 30 19:43:53 2000 +0000
description:
Pass the correct destination address for the route-to-gateway case.
>From Zdenek Salvet, kern/10483.
diffstat:
sys/netinet/ip_flow.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r f22d7f67fda5 -r 06be2080bb52 sys/netinet/ip_flow.c
--- a/sys/netinet/ip_flow.c Fri Jun 30 18:58:42 2000 +0000
+++ b/sys/netinet/ip_flow.c Fri Jun 30 19:43:53 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_flow.c,v 1.15 2000/06/28 03:01:16 mrg Exp $ */
+/* $NetBSD: ip_flow.c,v 1.16 2000/06/30 19:43:53 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -147,6 +147,7 @@
struct ip *ip;
struct ipflow *ipf;
struct rtentry *rt;
+ struct sockaddr *dst;
int error;
int iplen;
@@ -227,8 +228,13 @@
*/
ipf->ipf_uses++;
PRT_SLOW_ARM(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
Home |
Main Index |
Thread Index |
Old Index