diff options
author | David Ward <david.ward@ll.mit.edu> | 2009-08-29 03:04:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-29 03:04:09 -0400 |
commit | 31ce8c71a3bdab12debb5899b1f6dac13e54c71d (patch) | |
tree | 1c1e02ec7b5953669b58c79c1f7d7d5b962f5c07 /net | |
parent | 078b0735881c7969aaf21469f3577831cddd9f8c (diff) |
ipv6: Update Neighbor Cache when IPv6 RA is received on a router
When processing a received IPv6 Router Advertisement, the kernel
creates or updates an IPv6 Neighbor Cache entry for the sender --
but presently this does not occur if IPv6 forwarding is enabled
(net.ipv6.conf.*.forwarding = 1), or if IPv6 Router Advertisements
are not accepted (net.ipv6.conf.*.accept_ra = 0), because in these
cases processing of the Router Advertisement has already halted.
This patch allows the Neighbor Cache to be updated in these cases,
while still avoiding any modification to routes or link parameters.
This continues to satisfy RFC 4861, since any entry created in the
Neighbor Cache as the result of a received Router Advertisement is
still placed in the STALE state.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ndisc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 1ba42bd65577..44b4c87e5cce 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1151,10 +1151,6 @@ static void ndisc_router_discovery(struct sk_buff *skb) | |||
1151 | skb->dev->name); | 1151 | skb->dev->name); |
1152 | return; | 1152 | return; |
1153 | } | 1153 | } |
1154 | if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) { | ||
1155 | in6_dev_put(in6_dev); | ||
1156 | return; | ||
1157 | } | ||
1158 | 1154 | ||
1159 | if (!ndisc_parse_options(opt, optlen, &ndopts)) { | 1155 | if (!ndisc_parse_options(opt, optlen, &ndopts)) { |
1160 | in6_dev_put(in6_dev); | 1156 | in6_dev_put(in6_dev); |
@@ -1163,6 +1159,10 @@ static void ndisc_router_discovery(struct sk_buff *skb) | |||
1163 | return; | 1159 | return; |
1164 | } | 1160 | } |
1165 | 1161 | ||
1162 | /* skip route and link configuration on routers */ | ||
1163 | if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) | ||
1164 | goto skip_linkparms; | ||
1165 | |||
1166 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 1166 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
1167 | /* skip link-specific parameters from interior routers */ | 1167 | /* skip link-specific parameters from interior routers */ |
1168 | if (skb->ndisc_nodetype == NDISC_NODETYPE_NODEFAULT) | 1168 | if (skb->ndisc_nodetype == NDISC_NODETYPE_NODEFAULT) |
@@ -1283,9 +1283,7 @@ skip_defrtr: | |||
1283 | } | 1283 | } |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | ||
1287 | skip_linkparms: | 1286 | skip_linkparms: |
1288 | #endif | ||
1289 | 1287 | ||
1290 | /* | 1288 | /* |
1291 | * Process options. | 1289 | * Process options. |
@@ -1312,6 +1310,10 @@ skip_linkparms: | |||
1312 | NEIGH_UPDATE_F_ISROUTER); | 1310 | NEIGH_UPDATE_F_ISROUTER); |
1313 | } | 1311 | } |
1314 | 1312 | ||
1313 | /* skip route and link configuration on routers */ | ||
1314 | if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) | ||
1315 | goto out; | ||
1316 | |||
1315 | #ifdef CONFIG_IPV6_ROUTE_INFO | 1317 | #ifdef CONFIG_IPV6_ROUTE_INFO |
1316 | if (in6_dev->cnf.accept_ra_rtr_pref && ndopts.nd_opts_ri) { | 1318 | if (in6_dev->cnf.accept_ra_rtr_pref && ndopts.nd_opts_ri) { |
1317 | struct nd_opt_hdr *p; | 1319 | struct nd_opt_hdr *p; |