diff options
author | Aubrey.Li <aubreylee@gmail.com> | 2007-04-17 14:46:33 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-05-01 17:05:58 -0700 |
commit | 100f4756d42036cca5968ef82542ecf6bccbc8a1 (patch) | |
tree | 3fcbb77caf38e60781fae2e7e286adf1bb5d8488 /net | |
parent | 3300bb14330a902331bcdfd0f69d9b0945585c51 (diff) |
Fix netpoll UDP input path
Netpoll UDP input handler needs to pull up the UDP headers
and handle receive checksum offloading properly just like
the normal UDP input path does else we get corrupted
checksums.
[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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-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 823215d8e90..522e44173e5 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -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; |