NetBSD Problem Report #10483
Received: (qmail 25236 invoked from network); 30 Jun 2000 06:39:42 -0000
Message-Id: <200006300639.IAA15304@elanor.sci.muni.cz>
Date: Fri, 30 Jun 2000 08:39:39 +0200 (MEST)
From: salvet@ics.muni.cz
Reply-To: salvet@ics.muni.cz
To: gnats-bugs@gnats.netbsd.org
Subject: ipflow_fastforward() passes incorrect address to if_output (+fix)
X-Send-Pr-Version: 3.95
>Number: 10483
>Category: kern
>Synopsis: ipflow_fastforward() passes incorrect address to if_output (+fix)
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 30 06:40:00 +0000 2000
>Closed-Date: Fri Jun 30 19:44:29 +0000 2000
>Last-Modified: Fri Jun 30 19:44:29 +0000 2000
>Originator: Zdenek Salvet
>Release: 1.4.2, -current of 6/29/2000
>Organization:
Masaryk University, Brno, Czech Republic
>Environment:
options GATEWAY
>Description:
ipflow_fastforward() passes destination address instead of
the address of the gateway when using route to gateway.
The address is used to make the ARP requests after ARP table entry expires.
If it is incorrect, ARP will fail and all traffic using the gateway
will stop until correct ARP request is triggered (for tens of seconds
in my situation).
>How-To-Repeat:
machine1# route add -host machine2 router1-int1
router1# route add -host machine2 router2-int1
machine1# ttcp -t -u machine2
router1# arp -d router2-int1
# or wait until ARP table entry expires (20 min)
>Fix:
(diff against 1.4.2)
diff -u netinet/ip_flow.c.orig netinet/ip_flow.c
--- netinet/ip_flow.c.orig Thu Jun 29 19:18:39 2000
+++ netinet/ip_flow.c Thu Jun 29 19:32:19 2000
@@ -146,6 +146,7 @@
struct ip *ip;
struct ipflow *ipf;
struct rtentry *rt;
+ struct sockaddr *dst;
int error;
int iplen;
@@ -226,8 +227,14 @@
*/
ipf->ipf_uses++;
PRT_SLOW_ARM(ipf->ipf_timer, IPFLOW_TIMER);
+
+ 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,
- &ipf->ipf_ro.ro_dst, rt)) != 0) {
+ dst, rt)) != 0) {
if (error == ENOBUFS)
ipf->ipf_dropped++;
else
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: thorpej
State-Changed-When: Fri Jun 30 12:44:20 PDT 2000
State-Changed-Why:
Fixed, thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.