From: Alexander Duyck <alexander.duyck@gmail.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipv6: recreate ipv6 link-local addresses when increasing MTU over IPV6_MIN_MTU
Date: Mon, 26 Oct 2015 10:07:32 -0700 [thread overview]
Message-ID: <562E5DD4.40908@gmail.com> (raw)
In-Reply-To: <1445875501.168420.420547673.4BB6C209@webmail.messagingengine.com>
On 10/26/2015 09:05 AM, Hannes Frederic Sowa wrote:
> Hi Alex,
>
> On Mon, Oct 26, 2015, at 16:52, Alexander Duyck wrote:
>> On 10/26/2015 07:36 AM, Hannes Frederic Sowa wrote:
>>> Take into consideration that the interface might be disabled for IPv6,
>>> thus switch event type.
>>>
>>> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>>> ---
>>> net/ipv6/addrconf.c | 7 +++++--
>>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>>> index d0c685c..c2dcebe 100644
>>> --- a/net/ipv6/addrconf.c
>>> +++ b/net/ipv6/addrconf.c
>>> @@ -3149,6 +3149,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
>>>
>>> case NETDEV_UP:
>>> case NETDEV_CHANGE:
>>> +netdev_change:
>>> if (dev->flags & IFF_SLAVE)
>>> break;
>>>
>>> @@ -3244,8 +3245,10 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
>>>
>>> if (!idev && dev->mtu >= IPV6_MIN_MTU) {
>>> idev = ipv6_add_dev(dev);
>>> - if (!IS_ERR(idev))
>>> - break;
>>> + if (!IS_ERR(idev)) {
>>> + event = NETDEV_UP;
>>> + goto netdev_change;
>>> + }
>>> }
>>>
>>> /*
>> Seems like this code isn't quite correct. You are calling ipv6_add_dev
>> for slave devices, and if I understand things correctly I don't believe
>> that was happening before and may be an unintended side effect.
> Hmm, could you quickly help me where I get into this situation? I made
> sure I enter the NETDEV_UP part before the IFF_SLAVE test and
> disable_ipv6 te
I think I was getting a bit a head of myself. I was looking over the
NETDEV_UP code and thinking that we could just fall into that path since
it is already calling ipv6_add_dev. However now I am wondering if maybe
we need to look at adding an idev allocation somewhere before the
disable_ipv6 check. I assume that is why you were allocating the idev
before you were getting into NETDEV_UP?
>> You might want to instead just make it so that you only do the jump, and
>> perhaps change the code in the NETDEV_UP/NETDEV_CHANGE section so that
>> you test for NETDEV_CHANGE instead of NETDEV_UP. That should be enough
>> to get the effect you are looking for and I believe there would be no
>> change to behaviour other than adding IPv6 link-local addresses when the
>> MTU is increased.
>>
>> Give me a bit and I can submit an alternative that may actually work out
>> a bit better I think.
> If you go the NETDEV_CHANGE route instead of NETDEV_UP, you end up with
> the IF_READY flag already set from ipv6_add_dev and thus won't do any
> initialization of the device.
What I meant was that you don't need to change the event. If you change
the check inside the NETDEV_UP/CHANGE code path so that it tests for
event != NETDEV_CHANGE instead of event == NETDEV_UP you don't need to
change the event type.
> Sure, I wait.
Might be a bit longer. I just realized that I think there is another
bug here where you are going through the NETDEV_UP path even though the
interface isn't up. I'll run through some testing this morning to work
out the kinks.
- Alex
next prev parent reply other threads:[~2015-10-26 17:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 14:36 [PATCH net-next] ipv6: recreate ipv6 link-local addresses when increasing MTU over IPV6_MIN_MTU Hannes Frederic Sowa
2015-10-26 15:52 ` Alexander Duyck
2015-10-26 16:05 ` Hannes Frederic Sowa
2015-10-26 17:07 ` Alexander Duyck [this message]
2015-10-26 17:21 ` Hannes Frederic Sowa
2015-10-26 19:05 ` Hannes Frederic Sowa
2015-10-26 16:33 ` Hannes Frederic Sowa
2015-10-26 19:16 ` Jay Vosburgh
2015-10-26 20:45 ` Hannes Frederic Sowa
2015-10-26 20:52 ` Alexander Duyck
2015-10-26 18:06 ` [net-next PATCH v2] " Alexander Duyck
2015-10-30 9:11 ` 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=562E5DD4.40908@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=hannes@stressinduktion.org \
--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.