linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Rekorajski <baggins@sith.mimuw.edu.pl>
To: kuznet@ms2.inr.ac.ru
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH] /proc/sys/net/ipv6/conf/*/autoconf_route
Date: Tue, 7 Nov 2000 15:55:27 +0100	[thread overview]
Message-ID: <20001107155527.F4686@sith.mimuw.edu.pl> (raw)

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

Hi,
This patch adds /proc/sys/net/ipv6/conf/*/autoconf_route
that controls if default route is added or not if there are no routers
on the link, it also makes use of gcc struct initializers.
If putting new members inside a struct or enum is a wrong thing here
I can change it. The patch is against 2.4.0-test9,10.

Jan
-- 
Jan Rękorajski            |  ALL SUSPECTS ARE GUILTY. PERIOD!
baggins<at>mimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, type MANIAC         |                   -- TROOPS by Kevin Rubio

[-- Attachment #2: autoconf_route.patch --]
[-- Type: text/plain, Size: 4326 bytes --]

diff -ur linux.orig/include/linux/sysctl.h linux.v6/include/linux/sysctl.h
--- linux.orig/include/linux/sysctl.h	Fri Sep 22 23:21:22 2000
+++ linux.v6/include/linux/sysctl.h	Sat Oct 14 21:41:18 2000
@@ -342,10 +342,11 @@
 	NET_IPV6_ACCEPT_RA=4,
 	NET_IPV6_ACCEPT_REDIRECTS=5,
 	NET_IPV6_AUTOCONF=6,
-	NET_IPV6_DAD_TRANSMITS=7,
-	NET_IPV6_RTR_SOLICITS=8,
-	NET_IPV6_RTR_SOLICIT_INTERVAL=9,
-	NET_IPV6_RTR_SOLICIT_DELAY=10
+	NET_IPV6_AUTOCONF_ROUTE=7,
+	NET_IPV6_DAD_TRANSMITS=8,
+	NET_IPV6_RTR_SOLICITS=9,
+	NET_IPV6_RTR_SOLICIT_INTERVAL=10,
+	NET_IPV6_RTR_SOLICIT_DELAY=11
 };
 
 /* /proc/sys/net/<protocol>/neigh/<dev> */
diff -ur linux.orig/include/net/if_inet6.h linux.v6/include/net/if_inet6.h
--- linux.orig/include/net/if_inet6.h	Tue Sep 19 00:04:13 2000
+++ linux.v6/include/net/if_inet6.h	Sat Oct 14 21:38:40 2000
@@ -82,6 +82,7 @@
 	int		accept_ra;
 	int		accept_redirects;
 	int		autoconf;
+	int		autoconf_route;
 	int		dad_transmits;
 	int		rtr_solicits;
 	int		rtr_solicit_interval;
diff -ur linux.orig/net/ipv6/addrconf.c linux.v6/net/ipv6/addrconf.c
--- linux.orig/net/ipv6/addrconf.c	Wed May  3 10:48:03 2000
+++ linux.v6/net/ipv6/addrconf.c	Sun Oct 15 00:59:36 2000
@@ -21,6 +21,8 @@
  *	<chexum@bankinf.banki.hu>
  *	Andi Kleen			:	kill doube kfree on module
  *						unload.
+ *	Jan Rekorajski			:	added autoconf_route sysctl
+ *	<baggins@mimuw.edu.pl>
  */
 
 #include <linux/config.h>
@@ -96,30 +98,32 @@
 
 struct ipv6_devconf ipv6_devconf =
 {
-	0,				/* forwarding		*/
-	IPV6_DEFAULT_HOPLIMIT,		/* hop limit		*/
-	IPV6_MIN_MTU,			/* mtu			*/
-	1,				/* accept RAs		*/
-	1,				/* accept redirects	*/
-	1,				/* autoconfiguration	*/
-	1,				/* dad transmits	*/
-	MAX_RTR_SOLICITATIONS,		/* router solicits	*/
-	RTR_SOLICITATION_INTERVAL,	/* rtr solicit interval	*/
-	MAX_RTR_SOLICITATION_DELAY,	/* rtr solicit delay	*/
+	forwarding:		0,
+	hop_limit:		IPV6_DEFAULT_HOPLIMIT,
+	mtu6:			IPV6_MIN_MTU,
+	accept_ra:		1,
+	accept_redirects:	1,
+	autoconf:		1,
+	autoconf_route:		1,
+	dad_transmits:		1,
+	rtr_solicits:		MAX_RTR_SOLICITATIONS,
+	rtr_solicit_interval:	RTR_SOLICITATION_INTERVAL,
+	rtr_solicit_delay:	MAX_RTR_SOLICITATION_DELAY,
 };
 
 static struct ipv6_devconf ipv6_devconf_dflt =
 {
-	0,				/* forwarding		*/
-	IPV6_DEFAULT_HOPLIMIT,		/* hop limit		*/
-	IPV6_MIN_MTU,			/* mtu			*/
-	1,				/* accept RAs		*/
-	1,				/* accept redirects	*/
-	1,				/* autoconfiguration	*/
-	1,				/* dad transmits	*/
-	MAX_RTR_SOLICITATIONS,		/* router solicits	*/
-	RTR_SOLICITATION_INTERVAL,	/* rtr solicit interval	*/
-	MAX_RTR_SOLICITATION_DELAY,	/* rtr solicit delay	*/
+	forwarding:		0,
+	hop_limit:		IPV6_DEFAULT_HOPLIMIT,
+	mtu6:			IPV6_MIN_MTU,
+	accept_ra:		1,
+	accept_redirects:	1,
+	autoconf:		1,
+	autoconf_route:		1,
+	dad_transmits:		1,
+	rtr_solicits:		MAX_RTR_SOLICITATIONS,
+	rtr_solicit_interval:	RTR_SOLICITATION_INTERVAL,
+	rtr_solicit_delay:	MAX_RTR_SOLICITATION_DELAY,
 };
 
 int ipv6_addr_type(struct in6_addr *addr)
@@ -1430,15 +1434,17 @@
 		printk(KERN_DEBUG "%s: no IPv6 routers present\n",
 		       ifp->idev->dev->name);
 
-		memset(&rtmsg, 0, sizeof(struct in6_rtmsg));
-		rtmsg.rtmsg_type = RTMSG_NEWROUTE;
-		rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF;
-		rtmsg.rtmsg_flags = (RTF_ALLONLINK | RTF_ADDRCONF | 
-				     RTF_DEFAULT | RTF_UP);
+		if (ifp->idev->cnf.autoconf_route) {
+			memset(&rtmsg, 0, sizeof(struct in6_rtmsg));
+			rtmsg.rtmsg_type = RTMSG_NEWROUTE;
+			rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF;
+			rtmsg.rtmsg_flags = (RTF_ALLONLINK | RTF_ADDRCONF | 
+					     RTF_DEFAULT | RTF_UP);
 
-		rtmsg.rtmsg_ifindex = ifp->idev->dev->ifindex;
+			rtmsg.rtmsg_ifindex = ifp->idev->dev->ifindex;
 
-		ip6_route_add(&rtmsg);
+			ip6_route_add(&rtmsg);
+		}
 	}
 
 out:
@@ -1883,7 +1889,7 @@
 static struct addrconf_sysctl_table
 {
 	struct ctl_table_header *sysctl_header;
-	ctl_table addrconf_vars[11];
+	ctl_table addrconf_vars[12];
 	ctl_table addrconf_dev[2];
 	ctl_table addrconf_conf_dir[2];
 	ctl_table addrconf_proto_dir[2];
@@ -1912,6 +1918,10 @@
 
 	{NET_IPV6_AUTOCONF, "autoconf",
          &ipv6_devconf.autoconf, sizeof(int), 0644, NULL,
+         &proc_dointvec},
+
+	{NET_IPV6_AUTOCONF_ROUTE, "autoconf_route",
+         &ipv6_devconf.autoconf_route, sizeof(int), 0644, NULL,
          &proc_dointvec},
 
 	{NET_IPV6_DAD_TRANSMITS, "dad_transmits",

                 reply	other threads:[~2000-11-07 14:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001107155527.F4686@sith.mimuw.edu.pl \
    --to=baggins@sith.mimuw.edu.pl \
    --cc=davem@redhat.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).