Skip to content

Commit

Permalink
staging/octeon: Software should check the checksum of no tcp/udp packets
Browse files Browse the repository at this point in the history
Icmp packets with wrong checksum are never dropped since skb->ip_summed is
set to CHECKSUM_UNNECESSARY.

When icmp packets with wrong checksum pass through the octeon net driver,
the not_IP, IP_exc, L4_error hardware indicators show no error. so the
driver sets CHECKSUM_UNNECESSARY on skb->ip_summed.

L4_error only works for TCP/UDP, not for ICMP.

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
To: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: ralf@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2798/
Acked-by: David Daney <david.daney@cavium.com>
Cc: Greg KH <greg@kroah.com
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Roy.Li authored and Ralf Baechle committed Sep 27, 2011
1 parent 2f19d08 commit a4be637
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/octeon/ethernet-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
skb->protocol = eth_type_trans(skb, dev);
skb->dev = dev;

if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc || work->word2.s.L4_error))
if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc ||
work->word2.s.L4_error || !work->word2.s.tcp_or_udp))
skb->ip_summed = CHECKSUM_NONE;
else
skb->ip_summed = CHECKSUM_UNNECESSARY;
Expand Down

0 comments on commit a4be637

Please sign in to comment.