From jc@irbs.com  Tue Aug 13 12:32:01 2002
Return-Path: <jc@irbs.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 37D1537B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Aug 2002 12:32:01 -0700 (PDT)
Received: from exuma.irbs.com (exuma.irbs.com [216.86.160.252])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D743543E72
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Aug 2002 12:32:00 -0700 (PDT)
	(envelope-from jc@irbs.com)
Received: from localhost (localhost.irbs.com [127.0.0.1])
	by exuma.irbs.com (Postfix) with ESMTP id 07D551743D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Aug 2002 15:32:00 -0400 (EDT)
Received: by exuma.irbs.com (Postfix, from userid 2500)
	id C74A61743C; Tue, 13 Aug 2002 15:31:59 -0400 (EDT)
Message-Id: <20020813193159.C74A61743C@exuma.irbs.com>
Date: Tue, 13 Aug 2002 15:31:59 -0400 (EDT)
From: John Capo <jc@irbs.com>
Reply-To: John Capo <jc@irbs.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: PATCH to add sysctl knob to disable cloned route messages on routing socket
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41631
>Category:       kern
>Synopsis:       PATCH to add sysctl knob to disable cloned route messages on routing socket
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 13 12:40:01 PDT 2002
>Closed-Date:    Wed Nov 26 20:38:28 PST 2003
>Last-Modified:  Wed Nov 26 21:10:19 PST 2003
>Originator:     John Capo
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD exuma.irbs.com 4.6-STABLE FreeBSD 4.6-STABLE #0: Mon Jul 15 14:09:28 EDT 2002 jc@exuma.irbs.com:/usr/src/sys/compile/EXUMA i386


	
>Description:
	
>How-To-Repeat:
	
>Fix:

	


Index: sys/net/rtsock.c
===================================================================
RCS file: /usr/cvs/src/sys/net/rtsock.c,v
retrieving revision 1.44.2.9
diff -u -r1.44.2.9 rtsock.c
--- sys/net/rtsock.c	18 Feb 2002 15:26:35 -0000	1.44.2.9
+++ sys/net/rtsock.c	13 Aug 2002 18:16:57 -0000
@@ -84,6 +84,8 @@
 #define ifaaddr	info.rti_info[RTAX_IFA]
 #define brdaddr	info.rti_info[RTAX_BRD]
 
+static int send_clones = 1;
+
 /*
  * It really doesn't make any sense at all for this code to share much
  * with raw_usrreq.c, since its functionality is so restricted.  XXX
@@ -713,6 +715,8 @@
 	register struct mbuf *m;
 	struct sockaddr *sa = rtinfo->rti_info[RTAX_DST];
 
+	if (!send_clones && (flags & RTF_WASCLONED))
+		return;
 	if (route_cb.any_count == 0)
 		return;
 	m = rt_msg1(type, rtinfo);
@@ -1025,6 +1029,9 @@
 }
 
 SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock, "");
+SYSCTL_NODE(_net, OID_AUTO, rtsock, CTLFLAG_RD, 0, "Routing Socket");
+SYSCTL_INT(_net_rtsock, OID_AUTO, announce_clones, CTLFLAG_RW, &send_clones, 0, \
+	"Announce cloned routes on routing socket");
 
 /*
  * Definitions of protocols supported in the ROUTE domain.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:27:33 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=41631 
State-Changed-From-To: open->feedback 
State-Changed-By: bms 
State-Changed-When: Tue 25 Nov 2003 08:27:49 PST 
State-Changed-Why:  
Hi, the patch looks fairly simple and can probably be applied to -CURRENT 
with fixup. I'm puzzled as to why it is needed though - why can't your 
application be written to ignore the cloning messages? Feedback needed. 

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

From: John Capo <jc@irbs.com>
To: Bruce M Simpson <bms@FreeBSD.org>
Cc:  
Subject: Re: kern/41631: PATCH to add sysctl knob to disable cloned route messages on routing socket
Date: Tue, 25 Nov 2003 11:37:08 -0500

 Quoting Bruce M Simpson (bms@FreeBSD.org):
 > Synopsis: PATCH to add sysctl knob to disable cloned route messages on routing socket
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bms
 > State-Changed-When: Tue 25 Nov 2003 08:27:49 PST
 > State-Changed-Why: 
 > Hi, the patch looks fairly simple and can probably be applied to -CURRENT
 > with fixup. I'm puzzled as to why it is needed though - why can't your
 > application be written to ignore the cloning messages? Feedback needed.
 > 
 
 The application is gated and patching FreeBSD was eaiser than mucking
 about in gated.
 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=41631
 
State-Changed-From-To: feedback->closed 
State-Changed-By: bms 
State-Changed-When: Wed 26 Nov 2003 20:37:52 PST 
State-Changed-Why:  
Superseded by the introduction of Andre's routing changes, and eventual 
rewrite of layer 2 behaviour. 

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

From: Bruce M Simpson <bms@spc.org>
To: John Capo <jc@irbs.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/41631: PATCH to add sysctl knob to disable cloned route messages on routing socket
Date: Thu, 27 Nov 2003 04:37:39 +0000

 On Tue, Nov 25, 2003 at 11:37:08AM -0500, John Capo wrote:
 > The application is gated and patching FreeBSD was eaiser than mucking
 > about in gated.
 
 The routing code in -CURRENT no longer does PRCLONING, but cloning will
 take place for local subnet traffic using ARP until the layer 2 routing
 gets decoupled from the routing table which will happen after 5.2 is
 released.
 
 This looks like a judgement call between 'patch OS to workaround behaviour
 in application' and 'patch application to understand legitimate routing
 messages'. My feeling is - go with the latter, rather than introduce more
 complexity into the routing code. Therefore I'm closing this PR on those
 grounds.
 
 Thanks for the patch and the PR notification!
 
 Regards,
 BMS
>Unformatted:
