Skip to content

Commit c46358d

Browse files
brettsheffieldgregkh
authored andcommitted
Revert "ipv6: save dontfrag in cork"
This reverts commit 8ebf270 which is commit a18dfa9 upstream. A regression was introduced when backporting this to the stable kernels without applying previous commits in this series. When sending IPv6 UDP packets larger than MTU, EMSGSIZE was returned instead of fragmenting the packets as expected. As there is no compelling reason for this commit to be present in the stable kernels it should be reverted. Signed-off-by: Brett A C Sheffield <bacs@librecast.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1583d90 commit c46358d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

include/linux/ipv6.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ struct inet6_cork {
199199
struct ipv6_txoptions *opt;
200200
u8 hop_limit;
201201
u8 tclass;
202-
u8 dontfrag:1;
203202
};
204203

205204
/* struct ipv6_pinfo - ipv6 private area */

net/ipv6/ip6_output.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,6 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
14521452
}
14531453
v6_cork->hop_limit = ipc6->hlimit;
14541454
v6_cork->tclass = ipc6->tclass;
1455-
v6_cork->dontfrag = ipc6->dontfrag;
14561455
if (rt->dst.flags & DST_XFRM_TUNNEL)
14571456
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
14581457
READ_ONCE(rt->dst.dev->mtu) : dst_mtu(&rt->dst);
@@ -1486,7 +1485,7 @@ static int __ip6_append_data(struct sock *sk,
14861485
int getfrag(void *from, char *to, int offset,
14871486
int len, int odd, struct sk_buff *skb),
14881487
void *from, size_t length, int transhdrlen,
1489-
unsigned int flags)
1488+
unsigned int flags, struct ipcm6_cookie *ipc6)
14901489
{
14911490
struct sk_buff *skb, *skb_prev = NULL;
14921491
struct inet_cork *cork = &cork_full->base;
@@ -1542,7 +1541,7 @@ static int __ip6_append_data(struct sock *sk,
15421541
if (headersize + transhdrlen > mtu)
15431542
goto emsgsize;
15441543

1545-
if (cork->length + length > mtu - headersize && v6_cork->dontfrag &&
1544+
if (cork->length + length > mtu - headersize && ipc6->dontfrag &&
15461545
(sk->sk_protocol == IPPROTO_UDP ||
15471546
sk->sk_protocol == IPPROTO_ICMPV6 ||
15481547
sk->sk_protocol == IPPROTO_RAW)) {
@@ -1914,7 +1913,7 @@ int ip6_append_data(struct sock *sk,
19141913

19151914
return __ip6_append_data(sk, &sk->sk_write_queue, &inet->cork,
19161915
&np->cork, sk_page_frag(sk), getfrag,
1917-
from, length, transhdrlen, flags);
1916+
from, length, transhdrlen, flags, ipc6);
19181917
}
19191918
EXPORT_SYMBOL_GPL(ip6_append_data);
19201919

@@ -2119,7 +2118,7 @@ struct sk_buff *ip6_make_skb(struct sock *sk,
21192118
err = __ip6_append_data(sk, &queue, cork, &v6_cork,
21202119
&current->task_frag, getfrag, from,
21212120
length + exthdrlen, transhdrlen + exthdrlen,
2122-
flags);
2121+
flags, ipc6);
21232122
if (err) {
21242123
__ip6_flush_pending_frames(sk, &queue, cork, &v6_cork);
21252124
return ERR_PTR(err);

0 commit comments

Comments
 (0)