mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix UDP checksum issue in net poll mode.
@ 2007-04-17  6:53 Aubrey Li
  2007-04-17 19:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aubrey Li @ 2007-04-17  6:53 UTC (permalink / raw)
  To: davem, kuznet, pekkas, jmorris, kaber; +Cc: netdev, Linux Kernel

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>
---
 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 823215d..522e441 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;

-- 
1.5.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix UDP checksum issue in net poll mode.
  2007-04-17  6:53 [PATCH] Fix UDP checksum issue in net poll mode Aubrey Li
@ 2007-04-17 19:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-04-17 19:41 UTC (permalink / raw)
  To: aubreylee; +Cc: kuznet, pekkas, jmorris, kaber, netdev, linux-kernel

From: "Aubrey Li" <aubreylee@gmail.com>
Date: Tue, 17 Apr 2007 14:53:48 +0800

> 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>

This looks good, patch applied, thanks Aubrey.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-17 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-17  6:53 [PATCH] Fix UDP checksum issue in net poll mode Aubrey Li
2007-04-17 19:41 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®