All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Jarod Wilson <jarod@redhat.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Moshe Levi <moshele@mellanox.com>,
	Marcelo Ricardo Leitner <mleitner@redhat.com>,
	Netdev <netdev@vger.kernel.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH net] ipv6: don't auto-add link-local address to lag ports
Date: Thu, 19 Mar 2020 12:52:23 -0700	[thread overview]
Message-ID: <7028.1584647543@famine> (raw)
In-Reply-To: <CAKfmpScXTnnz6wQK3OZcqw4aM1PaLnBRfQL769JgyR7tgM-u5A@mail.gmail.com>

Jarod Wilson <jarod@redhat.com> wrote:

>On Thu, Mar 19, 2020 at 1:06 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>
>> On 3/19/20 9:42 AM, Jarod Wilson wrote:
>>
>> > Interesting. We'll keep digging over here, but that's definitely not
>> > working for this particular use case with OVS for whatever reason.
>>
>> I did a quick test and confirmed that my bonding slaves do not have link-local addresses,
>> without anything done to prevent them to appear.
>>
>> You might add a selftest, if you ever find what is the trigger :)
>
>Okay, have a basic reproducer, courtesy of Marcelo:
>
># ip link add name bond0 type bond
># ip link set dev ens2f0np0 master bond0
># ip link set dev ens2f1np2 master bond0
># ip link set dev bond0 up
># ip a s
>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
>group default qlen 1000
>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>    inet 127.0.0.1/8 scope host lo
>       valid_lft forever preferred_lft forever
>    inet6 ::1/128 scope host
>       valid_lft forever preferred_lft forever
>2: ens2f0np0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
>mq master bond0 state UP group default qlen 1000
>    link/ether 00:0f:53:2f:ea:40 brd ff:ff:ff:ff:ff:ff
>5: ens2f1np2: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc
>mq master bond0 state DOWN group default qlen 1000
>    link/ether 00:0f:53:2f:ea:40 brd ff:ff:ff:ff:ff:ff
>11: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
>noqueue state UP group default qlen 1000
>    link/ether 00:0f:53:2f:ea:40 brd ff:ff:ff:ff:ff:ff
>    inet6 fe80::20f:53ff:fe2f:ea40/64 scope link
>       valid_lft forever preferred_lft forever
>
>(above trimmed to relevant entries, obviously)
>
># sysctl net.ipv6.conf.ens2f0np0.addr_gen_mode=0
>net.ipv6.conf.ens2f0np0.addr_gen_mode = 0
># sysctl net.ipv6.conf.ens2f1np2.addr_gen_mode=0
>net.ipv6.conf.ens2f1np2.addr_gen_mode = 0
>
># ip a l ens2f0np0
>2: ens2f0np0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
>mq master bond0 state UP group default qlen 1000
>    link/ether 00:0f:53:2f:ea:40 brd ff:ff:ff:ff:ff:ff
>    inet6 fe80::20f:53ff:fe2f:ea40/64 scope link tentative
>       valid_lft forever preferred_lft forever
># ip a l ens2f1np2
>5: ens2f1np2: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc
>mq master bond0 state DOWN group default qlen 1000
>    link/ether 00:0f:53:2f:ea:40 brd ff:ff:ff:ff:ff:ff
>    inet6 fe80::20f:53ff:fe2f:ea40/64 scope link tentative
>       valid_lft forever preferred_lft forever
>
>Looks like addrconf_sysctl_addr_gen_mode() bypasses the original "is
>this a slave interface?" check, and results in an address getting
>added, while w/the proposed patch added, no address gets added.

	I wonder if this also breaks for the netvsc usage of IFF_SLAVE
to suppress ipv6 addrconf?  Adding the hyperv maintainers to Cc.

	In any event, it looks like addrconf_sysctl_addr_gen_mode()
calls addrconf_dev_config() directly, which bypasses the IFF_SLAVE check
in addrconf_notify() that would gate other callers.

	From my reading, your patch appears to cover a superset of cases
as compared to the existing IFF_SLAVE test from c2edacf80e15.

>Looking back through git history again, I see a bunch of 'Fixes:
>d35a00b8e33d ("net/ipv6: allow sysctl to change link-local address
>generation mode")' patches, and I guess that's where this issue was
>also introduced.

	Can the problem be induced via ip link set ... addrgenmode ?
That functionality predates the sysctl interface, looks like it was
introduced with

bc91b0f07ada ipv6: addrconf: implement address generation modes

	-J

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

  reply	other threads:[~2020-03-19 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 14:06 [PATCH net] ipv6: don't auto-add link-local address to lag ports Jarod Wilson
2020-03-18 18:02 ` Eric Dumazet
2020-03-18 18:32   ` Jarod Wilson
2020-03-18 20:41     ` Jay Vosburgh
2020-03-19 16:42       ` Jarod Wilson
2020-03-19 17:05         ` Eric Dumazet
2020-03-19 19:29           ` Jarod Wilson
2020-03-19 19:52             ` Jay Vosburgh [this message]
2020-03-19 21:53               ` Jarod Wilson
2020-03-19 22:41             ` Stephen Hemminger
2020-03-23 17:25               ` Jarod Wilson
2020-03-30 15:22                 ` [PATCH net v2] " Jarod Wilson
2020-04-01 18:14                   ` 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=7028.1584647543@famine \
    --to=jay.vosburgh@canonical.com \
    --cc=eric.dumazet@gmail.com \
    --cc=haiyangz@microsoft.com \
    --cc=jarod@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mleitner@redhat.com \
    --cc=moshele@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    /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.