3 @@ -1107,6 +1107,18 @@ errout:
4 rtnl_set_sk_err(net, RTNLGRP_ND_USEROPT, err);
7 +static inline int accept_ra(struct inet6_dev *in6_dev)
10 + * If forwarding is enabled, RA are not accepted unless the special
11 + * hybrid mode (accept_ra=2) is enabled.
13 + if (in6_dev->cnf.forwarding && in6_dev->cnf.accept_ra < 2)
16 + return in6_dev->cnf.accept_ra;
19 static void ndisc_router_discovery(struct sk_buff *skb)
21 struct ra_msg *ra_msg = (struct ra_msg *)skb_transport_header(skb);
22 @@ -1160,8 +1172,7 @@ static void ndisc_router_discovery(struc
26 - /* skip route and link configuration on routers */
27 - if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra)
28 + if (!accept_ra(in6_dev))
31 #ifdef CONFIG_IPV6_NDISC_NODETYPE
32 @@ -1311,8 +1322,7 @@ skip_linkparms:
33 NEIGH_UPDATE_F_ISROUTER);
36 - /* skip route and link configuration on routers */
37 - if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra)
38 + if (!accept_ra(in6_dev))
41 #ifdef CONFIG_IPV6_ROUTE_INFO