aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 7cfc8d284870..eef8d945b362 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -92,7 +92,7 @@ static void icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
92 if (type == ICMPV6_PKT_TOOBIG) 92 if (type == ICMPV6_PKT_TOOBIG)
93 ip6_update_pmtu(skb, net, info, 0, 0); 93 ip6_update_pmtu(skb, net, info, 0, 0);
94 else if (type == NDISC_REDIRECT) 94 else if (type == NDISC_REDIRECT)
95 ip6_redirect(skb, net, 0, 0); 95 ip6_redirect(skb, net, skb->dev->ifindex, 0);
96 96
97 if (!(type & ICMPV6_INFOMSG_MASK)) 97 if (!(type & ICMPV6_INFOMSG_MASK))
98 if (icmp6->icmp6_type == ICMPV6_ECHO_REQUEST) 98 if (icmp6->icmp6_type == ICMPV6_ECHO_REQUEST)
@@ -940,6 +940,14 @@ static const struct icmp6_err {
940 .err = ECONNREFUSED, 940 .err = ECONNREFUSED,
941 .fatal = 1, 941 .fatal = 1,
942 }, 942 },
943 { /* POLICY_FAIL */
944 .err = EACCES,
945 .fatal = 1,
946 },
947 { /* REJECT_ROUTE */
948 .err = EACCES,
949 .fatal = 1,
950 },
943}; 951};
944 952
945int icmpv6_err_convert(u8 type, u8 code, int *err) 953int icmpv6_err_convert(u8 type, u8 code, int *err)
@@ -951,7 +959,7 @@ int icmpv6_err_convert(u8 type, u8 code, int *err)
951 switch (type) { 959 switch (type) {
952 case ICMPV6_DEST_UNREACH: 960 case ICMPV6_DEST_UNREACH:
953 fatal = 1; 961 fatal = 1;
954 if (code <= ICMPV6_PORT_UNREACH) { 962 if (code < ARRAY_SIZE(tab_unreach)) {
955 *err = tab_unreach[code].err; 963 *err = tab_unreach[code].err;
956 fatal = tab_unreach[code].fatal; 964 fatal = tab_unreach[code].fatal;
957 } 965 }