linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] net: core: let skb_partial_csum_set() set transport header
@ 2013-03-27  9:11 Jason Wang
  2013-03-27  9:11 ` [PATCH net-next 2/3] net: core: introduce skb_probe_transport_header() Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jason Wang @ 2013-03-27  9:11 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet

For untrusted packets with partial checksum, we need to set the transport header
for precise packet length estimation. We can just let skb_pratial_csum_set() to
do this to avoid extra call to skb_flow_dissect() and simplify the caller.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/core/skbuff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 31c6737..ba64614 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3370,6 +3370,7 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
 	skb->ip_summed = CHECKSUM_PARTIAL;
 	skb->csum_start = skb_headroom(skb) + start;
 	skb->csum_offset = off;
+	skb_set_transport_header(skb, start);
 	return true;
 }
 EXPORT_SYMBOL_GPL(skb_partial_csum_set);
-- 
1.7.1


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

end of thread, other threads:[~2013-03-27 17:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-27  9:11 [PATCH net-next 1/3] net: core: let skb_partial_csum_set() set transport header Jason Wang
2013-03-27  9:11 ` [PATCH net-next 2/3] net: core: introduce skb_probe_transport_header() Jason Wang
2013-03-27 14:45   ` Eric Dumazet
2013-03-27 17:07     ` David Miller
2013-03-27  9:11 ` [PATCH net-next 3/3] net: switch to use skb_probe_transport_header() Jason Wang
2013-03-27 14:46   ` Eric Dumazet
2013-03-27 17:07     ` David Miller
2013-03-27 14:42 ` [PATCH net-next 1/3] net: core: let skb_partial_csum_set() set transport header Eric Dumazet
2013-03-27 17:07   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).