Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214285
b: refs/heads/master
c: 65e9b62
h: refs/heads/master
i:
  214283: 6cb1aa6
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Sep 3, 2010
1 parent 19e0095 commit 6d716fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc8acf2c8c3e43fcc192762a9f964b3e9a17748b
refs/heads/master: 65e9b62d4503849b10bedfc29bff0473760cc597
18 changes: 14 additions & 4 deletions trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,18 @@ static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)
rtnl_set_sk_err(net, RTNLGRP_ND_USEROPT, err);
}

static inline int accept_ra(struct inet6_dev *in6_dev)
{
/*
* If forwarding is enabled, RA are not accepted unless the special
* hybrid mode (accept_ra=2) is enabled.
*/
if (in6_dev->cnf.forwarding && in6_dev->cnf.accept_ra < 2)
return 0;

return in6_dev->cnf.accept_ra;
}

static void ndisc_router_discovery(struct sk_buff *skb)
{
struct ra_msg *ra_msg = (struct ra_msg *)skb_transport_header(skb);
Expand Down Expand Up @@ -1158,8 +1170,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
return;
}

/* skip route and link configuration on routers */
if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra)
if (!accept_ra(in6_dev))
goto skip_linkparms;

#ifdef CONFIG_IPV6_NDISC_NODETYPE
Expand Down Expand Up @@ -1309,8 +1320,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
NEIGH_UPDATE_F_ISROUTER);
}

/* skip route and link configuration on routers */
if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra)
if (!accept_ra(in6_dev))
goto out;

#ifdef CONFIG_IPV6_ROUTE_INFO
Expand Down

0 comments on commit 6d716fb

Please sign in to comment.