Skip to content

Commit

Permalink
net: Avoid access icmp_err_convert when icmp code is ICMP_FRAG_NEEDED
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miaohe Lin authored and David S. Miller committed Aug 25, 2020
1 parent 0caeba3 commit 7551144
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 7551144

Please sign in to comment.