Merge from HEAD@222728,222730.
This commit is contained in:
parent
9da723c303
commit
fc3c21e7da
@ -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);
|
||||
|
@ -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 */
|
||||
|
||||
/*
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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) &&
|
||||
|
@ -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
|
||||
|
@ -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,);
|
||||
|
@ -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) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user