3 @@ -1106,6 +1106,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 @@ -1151,7 +1163,7 @@ static void ndisc_router_discovery(struc
26 - if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) {
27 + if (!accept_ra(in6_dev)) {