Received: by oss.sgi.com id ; Thu, 22 Feb 2001 09:55:18 -0800 Received: from sith.mimuw.edu.pl ([193.0.97.1]:50948 "HELO sith.mimuw.edu.pl") by oss.sgi.com with SMTP id ; Thu, 22 Feb 2001 09:54:58 -0800 Received: (qmail 3724 invoked by uid 1645); 22 Feb 2001 17:58:41 -0000 Date: Thu, 22 Feb 2001 18:58:41 +0100 From: Jan Rekorajski To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?\(B" Cc: misiek@pld.ORG.PL, netdev@oss.sgi.com, usagi-users@linux-ipv6.org Subject: Re: why autoconfiguration work's while shouldn't ? :) Message-ID: <20010222185841.A2563@sith.mimuw.edu.pl> Mail-Followup-To: Jan Rekorajski , "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , misiek@pld.ORG.PL, netdev@oss.sgi.com, usagi-users@linux-ipv6.org References: <20010222175523.A17144@ikar.t17.ds.pwr.wroc.pl> <20010223021057L.yoshfuji@ecei.tohoku.ac.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <20010223021057L.yoshfuji@ecei.tohoku.ac.jp>; from yoshfuji@ecei.tohoku.ac.jp on Fri, Feb 23, 2001 at 02:10:57AM +0900 X-Operating-System: Linux 2.4.2-pre4 i686 Sender: owner-netdev@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;netdev-outgoing Content-Length: 5890 Lines: 185 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, 23 Feb 2001, YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B wrote: > In article <20010222175523.A17144@ikar.t17.ds.pwr.wroc.pl> (at Thu, 22 Feb 2001 17:55:23 +0100), Arkadiusz Miskiewicz says: > > > after a while when kernel tries autoconfiguration > > (Feb 22 17:51:30 arm kernel: eth0: no IPv6 routers present) > : > > default dev eth0 proto kernel metric 256 mtu 1500 > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > It adds few one default route which blows everything. > > Can someone explain me why such route is added? > : > > Bug or I'm missing something? > > This is not a bug. > > If there're no routers, we must assume all destination are on-link. > (RFC2461 5.2) As far as I remember the RFC and my discussion about this topic with ANK, there is no MUST. We should or may add this default route, but also we may give the ability to turn this behaviour off. Some time ago I made a patch that adds /proc/sys/net/ipv6/conf/*/autoconf_route sysctl just for this purpose. As the patch is small I attach it here. Jan -- Jan Rêkorajski | ALL SUSPECTS ARE GUILTY. PERIOD! bagginsmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="autoconf_route.patch" 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//neigh/ */ 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 @@ * Andi Kleen : kill doube kfree on module * unload. * Maciej W. Rozycki : FDDI support + * Jan Rekorajski : added autoconf_route sysctl + * */ #include @@ -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", --fUYQa+Pmc3FrFX/N--