提交 261663b0 编写于 作者: S Steffen Klassert 提交者: David S. Miller

ipv4: Don't use the cached pmtu informations for input routes

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 use the mtu of the outgoing device on packet forwarding instead
of the pmtu to the final destination.
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b8400f37
...@@ -1816,15 +1816,15 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst) ...@@ -1816,15 +1816,15 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
static unsigned int ipv4_mtu(const struct dst_entry *dst) static unsigned int ipv4_mtu(const struct dst_entry *dst)
{ {
const struct rtable *rt = (const struct rtable *) dst;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);
if (mtu) if (mtu && rt_is_output_route(rt))
return mtu; return mtu;
mtu = dst->dev->mtu; mtu = dst->dev->mtu;
if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
const struct rtable *rt = (const struct rtable *) dst;
if (rt->rt_gateway != rt->rt_dst && mtu > 576) if (rt->rt_gateway != rt->rt_dst && mtu > 576)
mtu = 576; mtu = 576;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册