From fc3c21e7daa042ecd95dabfaba0f5e46f1f54e4a Mon Sep 17 00:00:00 2001 From: hrs Date: Mon, 6 Jun 2011 02:46:22 +0000 Subject: [PATCH] Merge from HEAD@222728,222730. --- sys/netinet6/in6.c | 2 +- sys/netinet6/in6.h | 8 ++++---- sys/netinet6/in6_proto.c | 13 ++++++------- sys/netinet6/ip6_var.h | 10 +++++----- sys/netinet6/nd6.c | 6 +++--- sys/netinet6/nd6.h | 2 +- sys/netinet6/nd6_nbr.c | 3 +-- sys/netinet6/nd6_rtr.c | 9 +++++---- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index f9ec86374374..9558d1ba8a1d 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -673,7 +673,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, /* * Ignore failure of clearing the flag * intentionally. The failure means - * address duplication wes detected. + * address duplication was detected. */ } EVENTHANDLER_INVOKE(ifaddr_event, ifp); diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 50c3fa9b4c24..ae0da6aa0fff 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -611,10 +611,10 @@ struct ip6_mtuinfo { #define IPV6CTL_STEALTH 45 #define ICMPV6CTL_ND6_ONLINKNSRFC4861 47 -#define IPV6CTL_DEFROUTE_RTADV 48 /* Add a route in RA to defroute list.*/ -#define IPV6CTL_DISABLE_ISROUTER_RTADVIF 49 /* Disable R-bit in NA on RA - * receiving IF. */ -#define IPV6CTL_MAXID 50 +#define IPV6CTL_NO_RADR 48 /* No defroute from RA */ +#define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA + * receiving IF. */ +#define IPV6CTL_MAXID 50 #endif /* __BSD_VISIBLE */ /* diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 246300ff836d..9e78e9a9ab2a 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -409,8 +409,8 @@ VNET_DEFINE(int, ip6_sendredirects) = IPV6_SENDREDIRECTS; VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM; VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS; VNET_DEFINE(int, ip6_accept_rtadv) = 0; -VNET_DEFINE(int, ip6_defroute_rtadv) = 1; -VNET_DEFINE(int, ip6_disable_isrouter_rtadvif) = 0; +VNET_DEFINE(int, ip6_no_radr) = 0; +VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; @@ -539,14 +539,13 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 Router" "Advertisement messages"); -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DEFROUTE_RTADV, defroute_rtadv, - CTLFLAG_RW, &VNET_NAME(ip6_defroute_rtadv), 0, +SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, + CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, "Default value of per-interface flag to control whether routers " "sending ICMPv6 RA messages on that interface are added into the " "default router list."); -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DISABLE_ISROUTER_RTADVIF, - disable_isrouter_rtadvif, CTLFLAG_RW, - &VNET_NAME(ip6_disable_isrouter_rtadvif), 0, +SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NORBIT_RAIF, norbit_raif, CTLFLAG_RW, + &VNET_NAME(ip6_norbit_raif), 0, "Always set 0 to R flag in ICMPv6 NA messages when accepting RA" " on the interface."); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW, diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 4afa64e856c3..dbfba9a0b9e7 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -316,9 +316,9 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum packets in reassembly VNET_DECLARE(int, ip6_maxfrags); /* Maximum fragments in reassembly * queue */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ -VNET_DECLARE(int, ip6_defroute_rtadv); /* Add a route in RA to defroute list.*/ -VNET_DECLARE(int, ip6_disable_isrouter_rtadvif); /* Disable R-bit in NA on RA - * receiving IF. */ +VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ +VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA + * receiving IF. */ VNET_DECLARE(int, ip6_keepfaith); /* Firewall Aided Internet Translator */ VNET_DECLARE(int, ip6_log_interval); VNET_DECLARE(time_t, ip6_log_time); @@ -330,8 +330,8 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionTransmits */ #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) #define V_ip6_maxfrags VNET(ip6_maxfrags) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) -#define V_ip6_defroute_rtadv VNET(ip6_defroute_rtadv) -#define V_ip6_disable_isrouter_rtadvif VNET(ip6_disable_isrouter_rtadvif) +#define V_ip6_no_radr VNET(ip6_no_radr) +#define V_ip6_norbit_raif VNET(ip6_norbit_raif) #define V_ip6_keepfaith VNET(ip6_keepfaith) #define V_ip6_log_interval VNET(ip6_log_interval) #define V_ip6_log_time VNET(ip6_log_time) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index a722fb7941e6..231ce94ecbe3 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -193,8 +193,8 @@ nd6_ifattach(struct ifnet *ifp) /* A loopback interface does not need to accept RTADV. */ if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK)) nd->flags |= ND6_IFF_ACCEPT_RTADV; - if (V_ip6_defroute_rtadv && !(ifp->if_flags & IFF_LOOPBACK)) - nd->flags |= ND6_IFF_DEFROUTE_RTADV; + if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK)) + nd->flags |= ND6_IFF_NO_RADR; /* XXX: we cannot call nd6_setmtu since ifp is not fully initialized */ nd6_setmtu0(ifp, nd); @@ -1328,7 +1328,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) */ if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && (ND.flags & (ND6_IFF_ACCEPT_RTADV | - ND6_IFF_AUTO_LINKLOCAL))) + ND6_IFF_AUTO_LINKLOCAL))) ND.flags &= ~ND6_IFF_IFDISABLED; if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index a1e69b8655d9..6f6319210b7c 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -85,7 +85,7 @@ struct nd_ifinfo { */ #define ND6_IFF_DONT_SET_IFROUTE 0x10 #define ND6_IFF_AUTO_LINKLOCAL 0x20 -#define ND6_IFF_DEFROUTE_RTADV 0x40 +#define ND6_IFF_NO_RADR 0x40 #define ND6_CREATE LLE_CREATE #define ND6_EXCLUSIVE LLE_EXCLUSIVE diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index a4573d7f15ae..fb8e37921283 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -118,8 +118,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && - V_ip6_disable_isrouter_rtadvif) + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) rflag = 0; #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 567d8e1dd8ca..e791e2e3a7b9 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -270,12 +270,13 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) dr0.flags = nd_ra->nd_ra_flags_reserved; /* * Effectively-disable the route in the RA packet - * when !ND6_IFF_DEFROUTE_RTADV on the receiving interface. + * when ND6_IFF_NO_RADR on the receiving interface or + * ip6.forwarding=1. */ - if (ndi->flags & ND6_IFF_DEFROUTE_RTADV) - dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime); - else + if (ndi->flags & ND6_IFF_NO_RADR || V_ip6_forwarding) dr0.rtlifetime = 0; + else + dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime); dr0.expire = time_second + dr0.rtlifetime; dr0.ifp = ifp; /* unspecified or not? (RFC 2461 6.3.4) */