# "File descriptor in bad state" with OpenVPN [Solved]

## simoncSEM

Hi,

We have an OpenVPN server set up, which up until we updated our system (using emerge -uDva world) was working fine. 

In the update we updated 401 packages (our server hadn't been updated for some time), and openVPN went from version 2.0.1 to 2.0.6. 

We can start and stop openvpn, and remote access does seem to work, but OpenVPN forces our CPU usage up to 100%, and throws this to the log file, over and over again (seems to grow the log file by hundreds of megs every few seconds):

Tue Aug 21 08:54:00 2007 read from TUN/TAP : File descriptor in bad state (code=77)

The TUN/TAP device is built into our kernel (it was compiled as a module but we changed this in trying to fix this), and we've tried upgrading the kernel, downgrading the kernel, downgrading OpenVPN back to the previous version, running revdep-rebuild, and all of which seem to have no effect! 

From searching around other people have had the same error message due to permissions, or having the OpenVPN module compiled with the wrong headers, but we have tried recompiling the OpenVPN software and modules ( and eventually building it into the kernel instead ) and it hasn't made a difference.

Any ideas?Last edited by simoncSEM on Fri Aug 24, 2007 4:20 pm; edited 1 time in total

----------

## Corona688

Here's the permissions on my tun device:

```
$ ls -l /dev/net/tun

crw------- 1 root root 10, 200 Aug  9 08:51 /dev/net/tun
```

 What're yours?

----------

## simoncSEM

When we upgraded our box, it seems to have moved the device into /dev/tunl0, we created a symlink from /dev/net/tun to work around this because we couldn't find a way of changing the device it's pointing at in the configuration! 

simonc@sembox ~ $ ls -al /dev/net/tun

lrwxrwxrwx 1 root root 10 Aug 13 12:41 /dev/net/tun -> /dev/tunl0

simonc@sembox ~ $ ls -al /dev/tunl0

crw------- 1 root root 10, 200 Aug 10 12:58 /dev/tunl0

Thanks

----------

## simoncSEM

Looks like we've fixed it, I re-created the symlink and it seems to be working now. Strange how that fixed it, but it works so I'm happy  :Smile: 

Thanks anyway

----------

