git: kernel - Fix multiple issues with if_tap and if_tun cloning

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Aug 12 13:54:34 PDT 2020


commit 98a21dda18d58e69475cb708cac723e459407168
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Aug 12 13:47:43 2020 -0700

    kernel - Fix multiple issues with if_tap and if_tun cloning
    
    * tap and tun were being auto-destroyed when manually created via
      ifconfig blah create, and not being auto-destroyed when auto-created
      via open /dev/tap or open /dev/tun.  Reverse the flag so it works
      properly.
    
    * The bitmap for the ifconfig based cloner and the bitmap maintained
      internally by if_tap and if_tun could get out of sync with each
      other due to if_clone_free_unit(ifp, ...) being issued after
      the ifc_destroy() (the ifp is garbage at that point).
    
    * Remove a KASSERT() that can be triggered trivially from usermode
      (as root) in the interface cloning path.
    
    Reported-by: zrj

Summary of changes:
 sys/net/if_clone.c   | 43 +++++++++++++++++++++++++++++--------------
 sys/net/tap/if_tap.c |  4 ++--
 sys/net/tun/if_tun.c |  4 ++--
 3 files changed, 33 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/98a21dda18d58e69475cb708cac723e459407168


-- 
DragonFly BSD source repository


More information about the Commits mailing list