diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 4 | ||||
-rw-r--r-- | net/ipv6/sysctl_net_ipv6.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 5d420095190f..9a809a4b3d86 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -556,7 +556,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | |||
556 | 556 | ||
557 | saddr = &ipv6_hdr(skb)->daddr; | 557 | saddr = &ipv6_hdr(skb)->daddr; |
558 | 558 | ||
559 | if (!ipv6_unicast_destination(skb)) | 559 | if (!ipv6_unicast_destination(skb) && |
560 | !(net->ipv6.anycast_src_echo_reply && | ||
561 | ipv6_anycast_destination(skb))) | ||
560 | saddr = NULL; | 562 | saddr = NULL; |
561 | 563 | ||
562 | memcpy(&tmp_hdr, icmph, sizeof(tmp_hdr)); | 564 | memcpy(&tmp_hdr, icmph, sizeof(tmp_hdr)); |
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 107b2f1d90ae..6b6a2c83027e 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c | |||
@@ -24,6 +24,13 @@ static struct ctl_table ipv6_table_template[] = { | |||
24 | .mode = 0644, | 24 | .mode = 0644, |
25 | .proc_handler = proc_dointvec | 25 | .proc_handler = proc_dointvec |
26 | }, | 26 | }, |
27 | { | ||
28 | .procname = "anycast_src_echo_reply", | ||
29 | .data = &init_net.ipv6.anycast_src_echo_reply, | ||
30 | .maxlen = sizeof(int), | ||
31 | .mode = 0644, | ||
32 | .proc_handler = proc_dointvec | ||
33 | }, | ||
27 | { } | 34 | { } |
28 | }; | 35 | }; |
29 | 36 | ||
@@ -51,6 +58,7 @@ static int __net_init ipv6_sysctl_net_init(struct net *net) | |||
51 | if (!ipv6_table) | 58 | if (!ipv6_table) |
52 | goto out; | 59 | goto out; |
53 | ipv6_table[0].data = &net->ipv6.sysctl.bindv6only; | 60 | ipv6_table[0].data = &net->ipv6.sysctl.bindv6only; |
61 | ipv6_table[1].data = &net->ipv6.anycast_src_echo_reply; | ||
54 | 62 | ||
55 | ipv6_route_table = ipv6_route_sysctl_init(net); | 63 | ipv6_route_table = ipv6_route_sysctl_init(net); |
56 | if (!ipv6_route_table) | 64 | if (!ipv6_route_table) |