Commit fbf47813 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by David S. Miller

ip: unconditionally set cork gso_size

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.comSigned-off-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 678ca42d
...@@ -1146,8 +1146,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, ...@@ -1146,8 +1146,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
cork->fragsize = ip_sk_use_pmtu(sk) ? cork->fragsize = ip_sk_use_pmtu(sk) ?
dst_mtu(&rt->dst) : rt->dst.dev->mtu; dst_mtu(&rt->dst) : rt->dst.dev->mtu;
cork->gso_size = sk->sk_type == SOCK_DGRAM && cork->gso_size = ipc->gso_size;
sk->sk_protocol == IPPROTO_UDP ? ipc->gso_size : 0;
cork->dst = &rt->dst; cork->dst = &rt->dst;
cork->length = 0; cork->length = 0;
cork->ttl = ipc->ttl; cork->ttl = ipc->ttl;
......
...@@ -1219,8 +1219,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, ...@@ -1219,8 +1219,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
if (mtu < IPV6_MIN_MTU) if (mtu < IPV6_MIN_MTU)
return -EINVAL; return -EINVAL;
cork->base.fragsize = mtu; cork->base.fragsize = mtu;
cork->base.gso_size = sk->sk_type == SOCK_DGRAM && cork->base.gso_size = ipc6->gso_size;
sk->sk_protocol == IPPROTO_UDP ? ipc6->gso_size : 0;
cork->base.tx_flags = 0; cork->base.tx_flags = 0;
sock_tx_timestamp(sk, ipc6->sockc.tsflags, &cork->base.tx_flags); sock_tx_timestamp(sk, ipc6->sockc.tsflags, &cork->base.tx_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment