netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] udp6: respect IPV6_DONTFRAG sockopt in case there are pending frames
@ 2013-09-30 13:50 Jiri Pirko
  2013-09-30 17:56 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Pirko @ 2013-09-30 13:50 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuznet, jmorris, hannes, kaber, yoshfuji

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 4b340ae20d0e2366792abe70f46629e576adaf5e "IPv6: Complete IPV6_DONTFRAG support"

Please push to stable as well.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/ipv6/udp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 72b7eaa..1878609 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1225,9 +1225,6 @@ do_udp_sendmsg:
 	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 @@ back_from_confirm:
 	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,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-02 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-30 13:50 [patch net] udp6: respect IPV6_DONTFRAG sockopt in case there are pending frames Jiri Pirko
2013-09-30 17:56 ` Hannes Frederic Sowa
2013-09-30 21:21   ` Hannes Frederic Sowa
2013-10-01 22:03     ` Hannes Frederic Sowa
2013-10-02 20:00       ` David Miller
2013-10-02 20:45         ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).