diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2020-08-24 14:15:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-25 04:11:43 +0300 |
commit | 755114497815bd0931e2d0e95c5aa969dcf4aa25 (patch) | |
tree | f23e5aa026ce41f2c094a025a7a0021638f6c5c1 /net | |
parent | 0caeba3d3c1f08ecee4975d345858c19809475d7 (diff) | |
download | linux-755114497815bd0931e2d0e95c5aa969dcf4aa25.tar.xz |
net: Avoid access icmp_err_convert when icmp code is ICMP_FRAG_NEEDED
There is no need to fetch errno and fatal info from icmp_err_convert when
icmp code is ICMP_FRAG_NEEDED.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/raw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 1eb936f4a463..dfba39473b1d 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -260,11 +260,12 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info) err = EHOSTUNREACH; if (code > NR_ICMP_UNREACH) break; - err = icmp_err_convert[code].errno; - harderr = icmp_err_convert[code].fatal; if (code == ICMP_FRAG_NEEDED) { harderr = inet->pmtudisc != IP_PMTUDISC_DONT; err = EMSGSIZE; + } else { + err = icmp_err_convert[code].errno; + harderr = icmp_err_convert[code].fatal; } } |