Opened 14 years ago

Closed 11 years ago

#53 closed Bug / Defect (worksforme)

tun device was closed when starting daemon

Reported by: shakemid Owned by:
Priority: major Milestone:
Component: Generic / unclassified Version: OpenVPN 2.1.2 / 2.1.3 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: tun opensolaris


I used 2.0.9 on OpenSolaris? 2009.06. It worked well. But, 2.1.3 did not work well.
The configuration is the following.

openvpn --daemon --config server.conf
dev tun
proto udp

push "redirect-gateway def1"

ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem

keepalive 10 120

ifconfig-pool-persist ipp.txt
status openvpn-status.log
log-append /var/log/openvpn/openvpn.log

With daemon mode, tun device have been closed and routing have been deleted at once at starting. And, clients can connect, but can't send/receive packets. Output logs are the following.

Tue Sep 7 23:01:36 2010 TUN/TAP device tun0 opened
Tue Sep 7 23:01:36 2010 /usr/sbin/ifconfig tun0 mtu 1500 up
Tue Sep 7 23:01:36 2010 /usr/sbin/ifconfig tun0 netmask
add net gateway
Tue Sep 7 23:01:36 2010 UDPv4 link local (bound): [undef]:1194
Tue Sep 7 23:01:36 2010 UDPv4 link remote: [undef]
Tue Sep 7 23:01:36 2010 Initialization Sequence Completed
delete net gateway

I found openvpn_exit() is called after fork in misc.c. And, tun_abort() is called in openvpn_exit function, thus tun device is closed.

I modified error.c as follows.

$ diff error.c.orig error.c
< tun_abort();


After that, it seemed to work well.
Clients can connect, and can send/receive packets.

Change History (3)

comment:1 Changed 11 years ago by Samuli Seppänen

This bug report is very old. Can someobdy reproduce this with a recent OpenVPN/Solaris version?

comment:2 Changed 11 years ago by Samuli Seppänen

Keywords: tun opensolaris added

comment:3 Changed 11 years ago by Samuli Seppänen

Resolution: worksforme
Status: newclosed

Not confirmed on any recent openvpn versions. Closing, reopen if necessary.

Note: See TracTickets for help on using tickets.