Opened 2 years ago

Last modified 2 years ago

#735 new Bug / Defect

netbsd: named tap devices not auto-created

Reported by: Gert Döring Owned by:
Priority: minor Milestone: release 2.5
Component: Networking Version: OpenVPN git master branch (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc:

Description

running OpenVPN --dev tap3 on NetBSD 7.0.1 only works if that device has been manually created by ifconfig tap3 create before - and then, it still isn't behaving "properly" because ifconfig/route changes are not cleaned up on exit.

Mainly recording this so someone can look into it.

Code in question is in tun.c around line 1600

      if (!dynamic_opened)
        {
          /* has named device existed before? if so, don't destroy at end */
          if ( if_nametoindex( dev ) > 0 )
            {
              msg (M_INFO, "TUN/TAP device %s exists previously, keep at program
 end", dev );
              tt->persistent_if = true;
            }

          if ((tt->fd = open (tunname, O_RDWR)) < 0)
            msg (M_ERR, "Cannot open TUN/TAP dev %s", tunname);
        }

adding an #ifdef TARGET_NETBSD .. else if strncmp(dev, tap) == 0 ... exec("ifconfig $dev create") would work, but not make the code much prettier... (plus, it needs destroy at tun_close).

Change History (2)

comment:1 Changed 2 years ago by Gert Döring

Component: Generic / unclassifiedNetworking

comment:2 Changed 2 years ago by Gert Döring

Milestone: release 2.4release 2.5

this is not high prio (nobody on the NetBSD side has ever asked for it), and will not make the imminent 2.4 release - bumping to 2.5

Note: See TracTickets for help on using tickets.