Skip to content

Commit b80d171

Browse files
brettsheffieldgregkh
authored andcommitted
Revert "ipv6: save dontfrag in cork"
This reverts commit 4f809be which is commit a18dfa9925b9ef6107ea3aa5814ca3c704d34a8a 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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2a6cc07 commit b80d171

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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
/**

net/ipv6/ip6_output.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,6 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
14501450
}
14511451
v6_cork->hop_limit = ipc6->hlimit;
14521452
v6_cork->tclass = ipc6->tclass;
1453-
v6_cork->dontfrag = ipc6->dontfrag;
14541453
if (rt->dst.flags & DST_XFRM_TUNNEL)
14551454
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
14561455
READ_ONCE(rt->dst.dev->mtu) : dst_mtu(&rt->dst);
@@ -1484,7 +1483,7 @@ static int __ip6_append_data(struct sock *sk,
14841483
int getfrag(void *from, char *to, int offset,
14851484
int len, int odd, struct sk_buff *skb),
14861485
void *from, size_t length, int transhdrlen,
1487-
unsigned int flags)
1486+
unsigned int flags, struct ipcm6_cookie *ipc6)
14881487
{
14891488
struct sk_buff *skb, *skb_prev = NULL;
14901489
struct inet_cork *cork = &cork_full->base;
@@ -1540,7 +1539,7 @@ static int __ip6_append_data(struct sock *sk,
15401539
if (headersize + transhdrlen > mtu)
15411540
goto emsgsize;
15421541

1543-
if (cork->length + length > mtu - headersize && v6_cork->dontfrag &&
1542+
if (cork->length + length > mtu - headersize && ipc6->dontfrag &&
15441543
(sk->sk_protocol == IPPROTO_UDP ||
15451544
sk->sk_protocol == IPPROTO_ICMPV6 ||
15461545
sk->sk_protocol == IPPROTO_RAW)) {
@@ -1885,7 +1884,7 @@ int ip6_append_data(struct sock *sk,
18851884

18861885
return __ip6_append_data(sk, &sk->sk_write_queue, &inet->cork,
18871886
&np->cork, sk_page_frag(sk), getfrag,
1888-
from, length, transhdrlen, flags);
1887+
from, length, transhdrlen, flags, ipc6);
18891888
}
18901889
EXPORT_SYMBOL_GPL(ip6_append_data);
18911890

@@ -2090,7 +2089,7 @@ struct sk_buff *ip6_make_skb(struct sock *sk,
20902089
err = __ip6_append_data(sk, &queue, cork, &v6_cork,
20912090
&current->task_frag, getfrag, from,
20922091
length + exthdrlen, transhdrlen + exthdrlen,
2093-
flags);
2092+
flags, ipc6);
20942093
if (err) {
20952094
__ip6_flush_pending_frames(sk, &queue, cork, &v6_cork);
20962095
return ERR_PTR(err);

0 commit comments

Comments
 (0)