Commit 543e4faa authored by Julien Muchembled's avatar Julien Muchembled

iproute shipped by CentOS 6 is too old and does not provide 'tuntap' subcommand

parent 7ef3f232
...@@ -147,11 +147,13 @@ class TunnelManager(object): ...@@ -147,11 +147,13 @@ class TunnelManager(object):
def _tuntap(self, iface=None): def _tuntap(self, iface=None):
if iface: if iface:
self.new_iface_list.appendleft(iface) self.new_iface_list.appendleft(iface)
action = 'del' action = '--rmtun'
else: else:
iface = self.new_iface_list.popleft() iface = self.new_iface_list.popleft()
action = 'add' action = '--mktun'
args = 'ip', 'tuntap', action, 'dev', iface, 'mode', 'tap' # BBB: do not use 'ip tuntap' which is not available on old dists
args = ('openvpn', action, '--verb', '0',
'--dev', iface, '--dev-type', 'tap')
logging.debug('%r', args) logging.debug('%r', args)
subprocess.check_call(args) subprocess.check_call(args)
return iface return iface
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment