netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Willem de Bruijn <willemb@google.com>
Subject: [PATCH net-next 6/6] ip: unconditionally set cork gso_size
Date: Fri,  6 Jul 2018 10:12:59 -0400	[thread overview]
Message-ID: <20180706141259.29295-7-willemdebruijn.kernel@gmail.com> (raw)
In-Reply-To: <20180706141259.29295-1-willemdebruijn.kernel@gmail.com>

From: Willem de Bruijn <willemb@google.com>

Now that ipc(6)->gso_size is correctly initialized in all callers of
ip(6)_setup_cork, it is safe to unconditionally pass it to the cork.

Link: http://lkml.kernel.org/r/20180619164752.143249-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 net/ipv4/ip_output.c  | 3 +--
 net/ipv6/ip6_output.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index e14c774cc092..e2b6bd478afb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1146,8 +1146,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
 	cork->fragsize = ip_sk_use_pmtu(sk) ?
 			 dst_mtu(&rt->dst) : rt->dst.dev->mtu;
 
-	cork->gso_size = sk->sk_type == SOCK_DGRAM &&
-			 sk->sk_protocol == IPPROTO_UDP ? ipc->gso_size : 0;
+	cork->gso_size = ipc->gso_size;
 	cork->dst = &rt->dst;
 	cork->length = 0;
 	cork->ttl = ipc->ttl;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index ff4b28a600ab..8047fd41ba88 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1219,8 +1219,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
 	if (mtu < IPV6_MIN_MTU)
 		return -EINVAL;
 	cork->base.fragsize = mtu;
-	cork->base.gso_size = sk->sk_type == SOCK_DGRAM &&
-			      sk->sk_protocol == IPPROTO_UDP ? ipc6->gso_size : 0;
+	cork->base.gso_size = ipc6->gso_size;
 	cork->base.tx_flags = 0;
 	sock_tx_timestamp(sk, ipc6->sockc.tsflags, &cork->base.tx_flags);
 
-- 
2.18.0.399.gad0ab374a1-goog

  parent reply	other threads:[~2018-07-06 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 14:12 [PATCH net-next 0/6] sock cookie initializers Willem de Bruijn
2018-07-06 14:12 ` [PATCH net-next 1/6] ipv4: ipcm_cookie initializers Willem de Bruijn
2018-07-06 14:12 ` [PATCH net-next 2/6] ipv6: ipcm6_cookie initializer Willem de Bruijn
2018-07-06 14:12 ` [PATCH net-next 3/6] sock: sockc cookie initializer Willem de Bruijn
2018-07-06 14:12 ` [PATCH net-next 4/6] ipv6: fold sockcm_cookie into ipcm6_cookie Willem de Bruijn
2018-07-06 14:12 ` [PATCH net-next 5/6] ip: remove tx_flags from ipcm_cookie and use same logic for v4 and v6 Willem de Bruijn
2018-07-06 14:12 ` Willem de Bruijn [this message]
2018-07-06 17:19 ` [PATCH net-next 0/6] sock cookie initializers Jesus Sanchez-Palencia
2018-07-06 18:00   ` Willem de Bruijn
2018-07-07  1:59 ` 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=20180706141259.29295-7-willemdebruijn.kernel@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    /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 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).