From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/4] ipv4: Update pmtu informations on inetpeer only for output routes
Date: Tue, 11 Oct 2011 13:10:27 +0200 [thread overview]
Message-ID: <20111011111027.GE1830@secunet.com> (raw)
In-Reply-To: <20111011110842.GC1830@secunet.com>
The pmtu informations on the inetpeer are visible for output and
input routes. On packet forwarding, we might propagate a learned
pmtu to the sender. As we update the pmtu informations of the
inetpeer on demand, the original sender of the forwarded packets
might never notice when the pmtu to that inetpeer increases.
So propagate the nexthop mtu instead of the pmtu to the final
destination.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv4/route.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 075212e..9a6623e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1579,9 +1579,10 @@ unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph,
static void check_peer_pmtu(struct dst_entry *dst, struct inet_peer *peer)
{
+ struct rtable *rt = (struct rtable *) dst;
unsigned long expires = ACCESS_ONCE(peer->pmtu_expires);
- if (!expires)
+ if (rt_is_input_route(rt) || !expires)
return;
if (time_before(jiffies, expires)) {
u32 orig_dst_mtu = dst_mtu(dst);
@@ -1803,6 +1804,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4,
struct fib_info *fi)
{
struct inet_peer *peer;
+ struct dst_entry *dst = &rt->dst;
int create = 0;
/* If a peer entry exists for this destination, we must hook
@@ -1817,9 +1819,14 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4,
if (inet_metrics_new(peer))
memcpy(peer->metrics, fi->fib_metrics,
sizeof(u32) * RTAX_MAX);
- dst_init_metrics(&rt->dst, peer->metrics, false);
- check_peer_pmtu(&rt->dst, peer);
+ dst_init_metrics(dst, peer->metrics, false);
+ check_peer_pmtu(dst, peer);
+
+ if (rt_is_input_route(rt))
+ dst_metric_set(dst, RTAX_MTU,
+ dst->ops->default_mtu(dst));
+
if (peer->redirect_learned.a4 &&
peer->redirect_learned.a4 != rt->rt_gateway) {
rt->rt_gateway = peer->redirect_learned.a4;
@@ -1830,7 +1837,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4,
rt->fi = fi;
atomic_inc(&fi->fib_clntref);
}
- dst_init_metrics(&rt->dst, fi->fib_metrics, true);
+ dst_init_metrics(dst, fi->fib_metrics, true);
}
}
--
1.7.0.4
next prev parent reply other threads:[~2011-10-11 11:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 11:08 [PATCH net 0/4] ipv4: various pmtu discovery fixes Steffen Klassert
2011-10-11 11:09 ` [PATCH 1/4] ipv4: Fix pmtu propagating Steffen Klassert
2011-10-12 21:02 ` David Miller
2011-10-13 10:09 ` Steffen Klassert
2011-10-13 17:58 ` David Miller
2011-10-14 5:54 ` Steffen Klassert
2011-10-17 12:18 ` Steffen Klassert
2011-10-19 9:07 ` Gao feng
2011-10-19 19:32 ` David Miller
2011-11-08 19:19 ` David Miller
2011-11-08 19:33 ` David Miller
2011-11-09 12:08 ` Steffen Klassert
2011-11-21 7:56 ` Steffen Klassert
2011-12-01 18:40 ` David Miller
2011-10-11 11:10 ` Steffen Klassert [this message]
2011-10-12 21:08 ` [PATCH 2/4] ipv4: Update pmtu informations on inetpeer only for output routes David Miller
2011-10-14 6:34 ` Steffen Klassert
2011-11-08 19:36 ` David Miller
2011-11-09 12:11 ` Steffen Klassert
2011-11-14 10:12 ` Steffen Klassert
2011-11-14 19:33 ` David Miller
2011-11-15 10:00 ` Steffen Klassert
2011-11-22 13:20 ` Steffen Klassert
2011-10-11 11:11 ` [PATCH 3/4] ipv4: Fix inetpeer expiration handling Steffen Klassert
2011-10-20 6:24 ` Gao feng
2011-11-08 19:38 ` David Miller
2011-11-09 12:47 ` Steffen Klassert
2011-10-11 11:12 ` [PATCH 4/4] ipv4: Fix inetpeer expire time information Steffen Klassert
2011-10-11 19:54 ` [PATCH net 0/4] ipv4: various pmtu discovery fixes David Miller
2011-11-08 19:41 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111011111027.GE1830@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.