On Tue, Jul 05, 2022 at 09:15:48PM +0300, Vitaliy Makkoveev wrote: > pppoe_timeout() and pppoe_clone_destroy() are both executed with kernel > lock held, but they are not serialized because pppoe_timeout() has the > sleep point provided by netlock. We should use timeout_del_barrier(9) to > ensure pppoe_timeout() finished. Also pppoe_timeout() could be > rescheduled if the interface state `sc_state' is PPPOE_STATE_PADI_SENT > or PPPOE_STATE_PADR_SENT. The interface could be destroyed in any > connection state, so introduce new PPPOE_STATE_DYING state and use it to > prevent timeout rescheduling. > > Do sppp_detach() after if_detach(). It destroys some `ifp' data, so it > should be called after the interface was unlinked from the stack. > > Also do sppp_attach() before if_attach() call because initializes and > setups `ifp' data.
I don't have a pppoe(4) setup to test anymore, but this make sense to me.