git: tun/tap: Use make_only_dev() for the autoclone device

Aaron LI aly at crater.dragonflybsd.org
Thu Jul 2 16:02:01 PDT 2020


commit 33c70ba7672d54fa4425cc04f741eeb23f36e091
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Jun 28 23:06:33 2020 +0800

    tun/tap: Use make_only_dev() for the autoclone device
    
    It's recommended and more correct to use make_only_dev() for the
    autoclone device, because the later open action will call
    devfs_spec_open() to create the device node in '/dev'.  See also the
    make_autoclone_dev(9) man page.
    
    Because the device created by make_only_dev() doesn't appear in '/dev',
    devfs_find_device_by_name() cannot find it.  Therefore, we need to pass
    the cdev_t returned by make_only_dev() to if_clone_create() so that the
    {tun,tap}_clone_create() can get the device to create the tun/tap
    interface.
    
    Reviewed-by: dillon

Summary of changes:
 sys/net/tap/if_tap.c | 40 +++++++++++++++++++++-------------------
 sys/net/tun/if_tun.c | 40 +++++++++++++++++++++-------------------
 2 files changed, 42 insertions(+), 38 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/33c70ba7672d54fa4425cc04f741eeb23f36e091


-- 
DragonFly BSD source repository



More information about the Commits mailing list