Date: Thu, 20 Apr 2017 15:13:42 +0200 From: "Kristof Provost" <kristof@sigsegv.be> To: "Marko Zec" <zec@fer.hr> Cc: peter.blok@bsd4all.org, freebsd-net@freebsd.org Subject: Re: MFC VIMAGE fixes to 11-stable Message-ID: <60C3FBF7-7CF3-49AF-9DDF-0589AE9D9146@sigsegv.be> In-Reply-To: <20170420124256.1190665d@x23> References: <8E6FC1CD-24D5-46D5-A6A1-760DD612F92D@bsd4all.org> <20170420124256.1190665d@x23>
next in thread | previous in thread | raw e-mail | index | archive | help
On 20 Apr 2017, at 12:42, Marko Zec wrote: > The real culprit lies somewhere in PF code which operates on a wrong > vnet. Without a backtrace it's difficult to guess, but a quick read > reveals that > > pfi_initialize() > > is called from the default vnet context, and subsequently registers > interface eventhandlers so that all interface attach, change and > detach > events will be always executed in the default vnet, regardless of the > real vnet where the interfaces bound to the events actually reside. > In > other words, > > pfi_attach_group_event() > pfi_change_group_event() > pfi_detach_group_event() > > will operate fine only in the default vnet, but will wreak havoc > otherwise. Hence, those handlers should be fixed first. > I don’t think that’s right. The event handler doesn’t carry vnet information. It’s just called in whatever vnet is active when it’s invoked. There's no CURVNET_SET() in the EVENTHANDLER_INVOKE() macro. That means that we end up in pf_attach_group_event() with CURVNET set to the relevant vnet, not to the default vnet. There are certainly still issues with pf and vnets, but I don't think this is one. Regards, Kristof
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?60C3FBF7-7CF3-49AF-9DDF-0589AE9D9146>