From rpp@ci.com.au  Wed Oct  1 18:31:58 2003
Return-Path: <rpp@ci.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D736416A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 18:31:58 -0700 (PDT)
Received: from mippet.ci.com.au (mippet.ci.com.au [192.65.182.30])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3AF0C43FE3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 18:31:55 -0700 (PDT)
	(envelope-from rpp@ci.com.au)
Received: from mippet.ci.com.au (rpp@localhost [127.0.0.1])
	by mippet.ci.com.au (8.12.10/8.12.10/CE030811/c+m+l) with ESMTP id h921VmGx021622;
	Thu, 2 Oct 2003 11:31:49 +1000 (EST)
Received: (from rpp@localhost)
	by mippet.ci.com.au (8.12.10/8.12.10/Submit) id h921Vm9Y021621;
	Thu, 2 Oct 2003 11:31:48 +1000 (EST)
Message-Id: <200310020131.h921Vm9Y021621@mippet.ci.com.au>
Date: Thu, 2 Oct 2003 11:31:48 +1000 (EST)
From: Richard Perini <rpp@ci.com.au>
Reply-To: Richard Perini <rpp@ci.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc: rpp@mippet.ci.com.au
Subject: routed not ignoring cloned routes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57484
>Category:       bin
>Synopsis:       routed not ignoring cloned routes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 01 18:40:10 PDT 2003
>Closed-Date:    Tue Dec 13 00:51:54 GMT 2005
>Last-Modified:  Tue Dec 13 00:51:54 GMT 2005
>Originator:     Richard Perini
>Release:        CURRENT, 4-STABLE
>Organization:
Corinthian Engineering P/L Sydney
>Environment:
System: FreeBSD mippet.ci.com.au 4.7-STABLE FreeBSD 4.7-STABLE #2: Sun Feb 2 11:36:09 EST 2003 rpp@mippet.ci.com.au:/u1/usr-obj/usr/src/sys/LOCAL i386
>Description:
	Routed clobbers all cloned host routes in the kernel's routing
	table.  Symptoms are: higher than normal cpu time used by routed,
	some network functionality relying on presence of cloned host 
	routes fails, cloned routes absent from netstat -ra after starting 
	routed.

	First noticed when FreeBSD host running routed failed to respond to 
	a router's ICMP "Must_fragment" packet relating to a GRE tunnel
	having a smaller MTU size than the default 1500 mtu.
	
>How-To-Repeat:
>Fix:
	The following patch applied to FreeBSD 4-STABLE source fixes
	the problem.  Similar code exists in zebra and routed for
	recent BSDI and NetBSD found on www.rhyolite.com, which appears
	to be a reference site for BSD routed(?).

--- /usr/src/sbin/routed/table.c	Tue Sep 30 13:12:32 2003
+++ /u1/users/rpp/src/routed/table.c	Thu Oct  2 10:42:09 2003
@@ -1116,6 +1116,13 @@
 		if (rtm->rtm_flags & RTF_LLINFO)
 			continue;
 
+		/* ignore cloned routes
+		*/
+#if		defined(__FreeBSD__) && defined(RTF_WASCLONED)
+		if (rtm->rtm_flags & RTF_WASCLONED)
+			continue;
+#endif
+
 		/* ignore multicast addresses
 		 */
 		if (IN_MULTICAST(ntohl(S_ADDR(INFO_DST(&info)))))
@@ -1261,6 +1268,13 @@
 			trace_act("ignore ARP %s", str);
 			continue;
 		}
+
+#if		defined(__FreeBSD__) && defined(RTF_WASCLONED)
+		if (m.r.rtm.rtm_flags & RTF_WASCLONED){
+			trace_act("ignore cloned route %s", str);
+			continue;
+		}
+#endif
 
 		if (get_info_gate(&INFO_GATE(&info), &gate_sin)) {
 			gate = S_ADDR(INFO_GATE(&info));
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:19:42 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 
Not sure if routed is on a vendor branch, will check MAINTAINERS. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57484 
State-Changed-From-To: open->patched 
State-Changed-By: bms 
State-Changed-When: Tue Jun 15 00:23:31 GMT 2004 
State-Changed-Why:  
Applied to -CURRENT with fixups. A variant of this was already applied 
to rhyolite.com's sources for BSD/OS. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57484 

From: Bruce M Simpson <bms@spc.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/57484: routed not ignoring cloned routes
Date: Wed, 23 Jun 2004 03:24:42 +0100

 Note that a request has been posted to rhyolite to apply our
 patch to their original branch.
State-Changed-From-To: patched->closed 
State-Changed-By: bms 
State-Changed-When: Tue Dec 13 00:51:21 UTC 2005 
State-Changed-Why:  
-CURRENT is now -STABLE 
We haven't done a vendor branch import for a while, but a 
fix is in rhyolite's branch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57484 
>Unformatted:
