* [PATCH net] ipv4: consistent reporting of pmtu data in case of corking
@ 2013-12-19 1:13 Hannes Frederic Sowa
2013-12-22 23:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Frederic Sowa @ 2013-12-19 1:13 UTC (permalink / raw)
To: netdev
We report different pmtu values back on the first write and on further
writes on an corked socket.
Also don't include the dst.header_len (respectively exthdrlen) as this
should already be dealt with by the interface mtu of the outgoing
(virtual) interface and policy of that interface should dictate if
fragmentation should happen.
Instead reduce the pmtu data by IP options as we do for IPv6. Make the
same changes for ip_append_data, where we did not care about options or
dst.header_len at all.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv4/ip_output.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 9124027..df18461 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -828,7 +828,7 @@ static int __ip_append_data(struct sock *sk,
if (cork->length + length > maxnonfragsize - fragheaderlen) {
ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
- mtu-exthdrlen);
+ mtu - (opt ? opt->optlen : 0));
return -EMSGSIZE;
}
@@ -1151,7 +1151,8 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
mtu : 0xFFFF;
if (cork->length + size > maxnonfragsize - fragheaderlen) {
- ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, mtu);
+ ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
+ mtu - (opt ? opt->optlen : 0));
return -EMSGSIZE;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] ipv4: consistent reporting of pmtu data in case of corking
2013-12-19 1:13 [PATCH net] ipv4: consistent reporting of pmtu data in case of corking Hannes Frederic Sowa
@ 2013-12-22 23:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-12-22 23:52 UTC (permalink / raw)
To: hannes; +Cc: netdev
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 19 Dec 2013 02:13:36 +0100
> We report different pmtu values back on the first write and on further
> writes on an corked socket.
>
> Also don't include the dst.header_len (respectively exthdrlen) as this
> should already be dealt with by the interface mtu of the outgoing
> (virtual) interface and policy of that interface should dictate if
> fragmentation should happen.
>
> Instead reduce the pmtu data by IP options as we do for IPv6. Make the
> same changes for ip_append_data, where we did not care about options or
> dst.header_len at all.
>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Looks good, applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-22 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 1:13 [PATCH net] ipv4: consistent reporting of pmtu data in case of corking Hannes Frederic Sowa
2013-12-22 23:52 ` David Miller
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).