diff options
author | Matteo Croce <mcroce@redhat.com> | 2019-11-02 01:12:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-05 14:03:11 -0800 |
commit | 54074f1dbd6fbc0f0a085a54f3297ae26e424d59 (patch) | |
tree | 92febdbde61f84d4ff24efe5db7520126522be56 /net/ipv6/route.c | |
parent | 15122464d525f684a61806d28597050cdcef0f32 (diff) |
icmp: remove duplicate code
The same code which recognizes ICMP error packets is duplicated several
times. Use the icmp_is_err() and icmpv6_is_err() helpers instead, which
do the same thing.
ip_multipath_l3_keys() and tcf_nat_act() didn't check for all the error types,
assume that they should instead.
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c7a2022e64eb..bf2dac462942 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2291,10 +2291,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb, if (!icmph) goto out; - if (icmph->icmp6_type != ICMPV6_DEST_UNREACH && - icmph->icmp6_type != ICMPV6_PKT_TOOBIG && - icmph->icmp6_type != ICMPV6_TIME_EXCEED && - icmph->icmp6_type != ICMPV6_PARAMPROB) + if (!icmpv6_is_err(icmph->icmp6_type)) goto out; inner_iph = skb_header_pointer(skb, |