Skip to content

Commit

Permalink
[NET]: Fix UDP checksum issue in net poll mode.
Browse files Browse the repository at this point in the history
In net poll mode, the current checksum function doesn't consider the
kind of packet which is padded to reach a specific minimum length. I
believe that's the problem causing my test case failed. The following
patch fixed this issue.

Signed-off-by: Aubrey.Li <aubreylee@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Aubrey.Li authored and David S. Miller committed Apr 17, 2007
1 parent 55569ce commit 5e7d7fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ int __netpoll_rx(struct sk_buff *skb)
if (skb->len < len || len < iph->ihl*4)
goto out;

/*
* Our transport medium may have padded the buffer out.
* Now We trim to the true length of the frame.
*/
if (pskb_trim_rcsum(skb, len))
goto out;

if (iph->protocol != IPPROTO_UDP)
goto out;

Expand Down

0 comments on commit 5e7d7fa

Please sign in to comment.