ip: limit use of gso_size to udp
The ipcm(6)_cookie field gso_size is set only in the udp path. The ip
layer copies this to cork only if sk_type is SOCK_DGRAM. This check
proved too permissive. Ping and l2tp sockets have the same type.
Limit to sockets of type SOCK_DGRAM and protocol IPPROTO_UDP to
exclude ping sockets.
v1 -> v2
- remove irrelevant whitespace changes
Fixes: bec1f6f697
("udp: generate gso with UDP_SEGMENT")
Reported-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

gecommit door
David S. Miller

bovenliggende
b6cfffa7ad
commit
9887cba199
@@ -1219,7 +1219,8 @@ 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 ? ipc6->gso_size : 0;
|
||||
cork->base.gso_size = sk->sk_type == SOCK_DGRAM &&
|
||||
sk->sk_protocol == IPPROTO_UDP ? ipc6->gso_size : 0;
|
||||
|
||||
if (dst_allfrag(xfrm_dst_path(&rt->dst)))
|
||||
cork->base.flags |= IPCORK_ALLFRAG;
|
||||
|
Verwijs in nieuw issue
Block a user