mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
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>
This commit is contained in:
parent
0caeba3d3c
commit
7551144978
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user