Date: Tue, 16 Feb 2016 16:30:54 +0900 From: Ryota Ozaki <ozak...@netbsd.org>
On Tue, Feb 16, 2016 at 6:16 AM, Taylor R Campbell <campbell+netbsd-source-change...@mumble.net> wrote: > void > if_link_state_change(struct ifnet *ifp, int link_state) > { > int s; > > s = splnet(); > if (ifp->if_link_state_pending == link_state) > goto out; > > if (ifp->if_link_state_pending != ifp->if_link_state) { What does the conditional intend? I don't remember! It doesn't make sense now that I look at it again. This was just a sketch -- obviously it was missing some parts, such as pool_cache_put, and some parts seem to make no sense. I would just take it out. Anyway I made a patch based on the above code: http://www.netbsd.org/~ozaki-r/link_state_change.diff What I did are to make your code compilable and workable, and limit the number of pending events. Looks reasonable to me. We should have some automatic tests for all this, though!