提交 29a96e1f 编写于 作者: T Tom Herbert 提交者: David S. Miller

icmp: Call skb_checksum_simple_validate

Use skb_checksum_simple_validate to verify checksum.
Signed-off-by: NTom Herbert <therbert@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 de08dc1a
...@@ -908,16 +908,8 @@ int icmp_rcv(struct sk_buff *skb) ...@@ -908,16 +908,8 @@ int icmp_rcv(struct sk_buff *skb)
ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS); ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS);
switch (skb->ip_summed) { if (skb_checksum_simple_validate(skb))
case CHECKSUM_COMPLETE: goto csum_error;
if (!csum_fold(skb->csum))
break;
/* fall through */
case CHECKSUM_NONE:
skb->csum = 0;
if (__skb_checksum_complete(skb))
goto csum_error;
}
if (!pskb_pull(skb, sizeof(*icmph))) if (!pskb_pull(skb, sizeof(*icmph)))
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册