提交 e36d3ff9 编写于 作者: J Jiri Pirko 提交者: David S. Miller

udp6: respect IPV6_DONTFRAG sockopt in case there are pending frames

if up->pending != 0 dontfrag is left with default value -1. That
causes that application that do:
sendto len>mtu flag MSG_MORE
sendto len>mtu flag 0
will receive EMSGSIZE errno as the result of the second sendto.

This patch fixes it by respecting IPV6_DONTFRAG socket option.

introduced by:
commit 4b340ae2 "IPv6: Complete IPV6_DONTFRAG support"
Signed-off-by: NJiri Pirko <jiri@resnulli.us>
Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f2e5ddcc
......@@ -1225,9 +1225,6 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if (tclass < 0)
tclass = np->tclass;
if (dontfrag < 0)
dontfrag = np->dontfrag;
if (msg->msg_flags&MSG_CONFIRM)
goto do_confirm;
back_from_confirm:
......@@ -1246,6 +1243,8 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
up->pending = AF_INET6;
do_append_data:
if (dontfrag < 0)
dontfrag = np->dontfrag;
up->len += ulen;
getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag;
err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册