Date: Mon, 5 Aug 2013 11:20:35 +0000 From: "Newpol, Richard" <rnewpol@panasas.com> To: "freebsd-net@freebsd.org" <freebsd-net@FreeBSD.org> Subject: RE: Adding an address to a downed LAGG interface breaks it? Message-ID: <1A778AD3F807B340B7EB1BD1B9C196773D6566C8@zenyatta.int.panasas.com> In-Reply-To: <CB641B15-652F-40AF-80D0-8586BB0594F2@FreeBSD.org> References: <1A778AD3F807B340B7EB1BD1B9C196773D655FE6@zenyatta.int.panasas.com>, <CB641B15-652F-40AF-80D0-8586BB0594F2@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
By "inconsistent state" i just mean that the driver is not actually up, but= the IFF_UP flag is set. The problem is that when the interface is brought = up by the user after that (ifconfig lagg0 up), the part of the code that ad= ds the default subnet broadcast routes checks IFF_UP and sees it is set, so= it skips the route adds. Normally, the route adds (and a few other things)= are done before the IFF_UP flag is set.=0A= =0A= Rich Newpol=0A= Panasas=0A= ________________________________________=0A= From: Rui Paulo [rpaulo@FreeBSD.org]=0A= Sent: Sunday, August 04, 2013 3:05 PM=0A= To: Newpol, Richard=0A= Cc: freebsd-net@freebsd.org=0A= Subject: Re: Adding an address to a downed LAGG interface breaks it?=0A= =0A= On 1 Aug 2013, at 09:22, "Newpol, Richard" <rnewpol@panasas.com> wrote:=0A= =0A= > All,=0A= > We seem to have discovered a problem that occurs when adding an address (= or alias) to a DOWNed lagg interface. After adding an address, when you try= to bring the interface UP it can't reach the desired networks.=0A= >=0A= > Turns out that the problem occurs because the lagg driver silently passes= the SIOCSIFADDR ioctl to the "ether_ioctl" handler, which in turn always s= ets the IFF_UP flag.=0A= >=0A= > While this is usually ok (since ifconfig <if> <address> implies UP with t= he first assigned address anyway), the lagg driver does not have the proper= handling to actually change state to UP on the first address, so it ends u= p in an inconsistent state. Then, when the user eventually does an "ifconfi= g lagg up" the default subnet routes are not added (because the "interface = up" code sees that IFF_UP is already set).=0A= >=0A= > So my first question - is this a known problem, or has it been addressed = in some other way?=0A= >=0A= > Secondly, I can think of two ways to fix this, and was wondering what are= the implications. The first way would be for the lagg driver to correctly = bring itself up when the first address is added to it. The second way would= be for the lagg driver to preserve the state of IFF_FLAG when handling SIO= CSIFADDR. I like the second way because it is less of an overall behaviour = change from the current, but the first way seems more correct.=0A= =0A= =0A= After you add the first address, you said it comes to an inconsistent state= . Can you clarify?=0A= =0A= The first approach seems like the right fix but I don't know much about the= problem. The second way breaks the POLA because you're special casing lagg= just to work around a bug.=0A= =0A= --=0A= Rui Paulo=0A= =0A=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1A778AD3F807B340B7EB1BD1B9C196773D6566C8>