Skip to content
  • Gleb Smirnoff's avatar
    ng_l2tp: improve callout locking. · 89042ff7
    Gleb Smirnoff authored
    Apparently e62e4b85 wasn't enough to close the race between
    a queue being flushed by a packet and callout executing, because
    the callouts used without a lock aren't 100% bulletproof. To close
    the race use callout_init_mtx() for L2TP timers, and make sure that
    all calls to ng_callout()/ng_uncallout() are done under the seq lock.
    
    If used properly, a locked callout can be used transparently with
    old netgraph KPI of ng_callout/ng_uncallout which predates locked
    callouts.
    
    While here, utilize ng_uncallout_drain() instead of ng_uncallout()
    on the node shutdown.
    
    PR:			241133
    Reviewed by:		mjg, markj
    Differential Revision:	https://reviews.freebsd.org/D31476
    89042ff7