提交 d31c7b8f 编写于 作者: E Evgeniy Polyakov 提交者: Herbert Xu

[IPV6]: Restore IPv6 when MTU is big enough

Avaid provided test application, so bug got fixed.

IPv6 addrconf removes ipv6 inner device from netdev each time cmu
changes and new value is less than IPV6_MIN_MTU (1280 bytes).
When mtu is changed and new value is greater than IPV6_MIN_MTU,
it does not add ipv6 addresses and inner device bac.

This patch fixes that.

Tested with Avaid's application, which works ok now.
Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 d5a784b3
...@@ -2293,6 +2293,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, ...@@ -2293,6 +2293,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
break; break;
} }
if (!idev && dev->mtu >= IPV6_MIN_MTU)
idev = ipv6_add_dev(dev);
if (idev) if (idev)
idev->if_flags |= IF_READY; idev->if_flags |= IF_READY;
} else { } else {
...@@ -2357,12 +2360,18 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, ...@@ -2357,12 +2360,18 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
break; break;
case NETDEV_CHANGEMTU: case NETDEV_CHANGEMTU:
if ( idev && dev->mtu >= IPV6_MIN_MTU) { if (idev && dev->mtu >= IPV6_MIN_MTU) {
rt6_mtu_change(dev, dev->mtu); rt6_mtu_change(dev, dev->mtu);
idev->cnf.mtu6 = dev->mtu; idev->cnf.mtu6 = dev->mtu;
break; break;
} }
if (!idev && dev->mtu >= IPV6_MIN_MTU) {
idev = ipv6_add_dev(dev);
if (idev)
break;
}
/* MTU falled under IPV6_MIN_MTU. Stop IPv6 on this interface. */ /* MTU falled under IPV6_MIN_MTU. Stop IPv6 on this interface. */
case NETDEV_DOWN: case NETDEV_DOWN:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册