All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Herbert <therbert@google.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH net-next 4/5] udp: Add try convert checksum is case of skb_steal_sock
Date: Sun,  7 Sep 2014 22:26:28 -0700	[thread overview]
Message-ID: <1410153989-23837-5-git-send-email-therbert@google.com> (raw)
In-Reply-To: <1410153989-23837-1-git-send-email-therbert@google.com>

If an skb already has an associated socket that we can steal
in UDP receive then attempt checksum conversion before calling
udp_queue_rcv_skb.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv4/udp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cd0db54..50d3b5c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1769,6 +1769,10 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
 		if (unlikely(sk->sk_rx_dst != dst))
 			udp_sk_rx_dst_set(sk, dst);
 
+		if (udp_sk(sk)->convert_csum && uh->check && !IS_UDPLITE(sk))
+			skb_checksum_try_convert(skb, IPPROTO_UDP, uh->check,
+						 inet_compute_pseudo);
+
 		ret = udp_queue_rcv_skb(sk, skb);
 		sock_put(sk);
 		/* a return value > 0 means to resubmit the input, but
-- 
2.1.0.rc2.206.gedb03e5

  parent reply	other threads:[~2014-09-08  5:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08  5:26 [PATCH net-next 0/5] net: Changes to GRO for encapsulation Tom Herbert
2014-09-08  5:26 ` [PATCH net-next 1/5] net: Fix GRE RX to use skb_transport_header for GRE header offset Tom Herbert
2014-09-08 10:37   ` Eric Dumazet
2014-09-08  5:26 ` [PATCH net-next 2/5] ipip: Add gro callbacks to ipip offload Tom Herbert
2014-09-08  5:26 ` [PATCH net-next 3/5] sit: Add gro callbacks to sit offload Tom Herbert
2014-09-08 11:55   ` Eric Dumazet
2014-09-08  5:26 ` Tom Herbert [this message]
2014-09-08  5:26 ` [PATCH net-next 5/5] net: Export inet_offloads and inet6_offloads Tom Herbert
2014-09-08 10:42   ` Eric Dumazet
2014-09-09 19:18 ` [PATCH net-next 0/5] net: Changes to GRO for encapsulation David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410153989-23837-5-git-send-email-therbert@google.com \
    --to=therbert@google.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.