Bug 32673

Summary: /dev/net/tun is created as a regular file if missing
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: vpnc-scriptAssignee: Alexey Shabalin <shaba>
Status: NEW --- QA Contact: qa-sisyphus
Severity: minor    
Priority: P3 CC: shaba
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2016-10-27 14:43:27 MSK
vpnc-script-0.5.3-alt6

In a system without systemd (and without any preceding "modprobe tun"), openconnect (which must be using vpnc-script):

* would fail with unclear errors like this:

	ioctl(5, TUNSETIFF, 0x7fffbc71f7d0) = -1 ENOTTY (Inappropriate ioctl for device)

* and would have created /dev/net/tun as a regular file like this:

	open("/dev/net/tun", O_RDWR|O_CREAT, 0666) = 3

(which would prevent the creation of a correct device afterwards).

A similar case (probably, the same bug) has been reported as a Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780709

Work-around:

rm /dev/net/tun # if it's a wrong regular file
modprobe -r tun
modprobe tun