diff options
author | Aubrey.Li <aubreylee@gmail.com> | 2007-04-17 15:40:20 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-17 16:13:26 -0400 |
commit | 5e7d7fa57323dfb48fb09464cf4542daa7ce8a72 (patch) | |
tree | 608dee7ca9e99458e3f6ad799e23e607322e95a1 /net/core/netpoll.c | |
parent | 55569ce256ce29f4624f0007213432c1ed646584 (diff) |
[NET]: Fix UDP checksum issue in net poll mode.
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>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index da1019451cc..4581ece48bb 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -471,6 +471,13 @@ int __netpoll_rx(struct sk_buff *skb) | |||
471 | if (skb->len < len || len < iph->ihl*4) | 471 | if (skb->len < len || len < iph->ihl*4) |
472 | goto out; | 472 | goto out; |
473 | 473 | ||
474 | /* | ||
475 | * Our transport medium may have padded the buffer out. | ||
476 | * Now We trim to the true length of the frame. | ||
477 | */ | ||
478 | if (pskb_trim_rcsum(skb, len)) | ||
479 | goto out; | ||
480 | |||
474 | if (iph->protocol != IPPROTO_UDP) | 481 | if (iph->protocol != IPPROTO_UDP) |
475 | goto out; | 482 | goto out; |
476 | 483 | ||