diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-10-19 06:29:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-19 19:20:52 -0400 |
commit | e36d3ff91130002c7c2d1d6a55556991da1daecc (patch) | |
tree | d92b582ce75873973b4fed7d4b2c1dd5fdf18b82 /net | |
parent | f2e5ddcc0d12f9c4c7b254358ad245c9dddce13b (diff) |
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 4b340ae20d0e2366792abe70f46629e576adaf5e "IPv6: Complete IPV6_DONTFRAG support"
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/udp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 72b7eaaf3ca0..18786098fd41 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1225,9 +1225,6 @@ do_udp_sendmsg: | |||
1225 | if (tclass < 0) | 1225 | if (tclass < 0) |
1226 | tclass = np->tclass; | 1226 | tclass = np->tclass; |
1227 | 1227 | ||
1228 | if (dontfrag < 0) | ||
1229 | dontfrag = np->dontfrag; | ||
1230 | |||
1231 | if (msg->msg_flags&MSG_CONFIRM) | 1228 | if (msg->msg_flags&MSG_CONFIRM) |
1232 | goto do_confirm; | 1229 | goto do_confirm; |
1233 | back_from_confirm: | 1230 | back_from_confirm: |
@@ -1246,6 +1243,8 @@ back_from_confirm: | |||
1246 | up->pending = AF_INET6; | 1243 | up->pending = AF_INET6; |
1247 | 1244 | ||
1248 | do_append_data: | 1245 | do_append_data: |
1246 | if (dontfrag < 0) | ||
1247 | dontfrag = np->dontfrag; | ||
1249 | up->len += ulen; | 1248 | up->len += ulen; |
1250 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; | 1249 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; |
1251 | err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen, | 1250 | err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen, |