summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/vpnprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/services/eip/vpnprocess.py')
-rw-r--r--src/leap/bitmask/services/eip/vpnprocess.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py
index 71a21cdb..cbcdd5c6 100644
--- a/src/leap/bitmask/services/eip/vpnprocess.py
+++ b/src/leap/bitmask/services/eip/vpnprocess.py
@@ -185,7 +185,8 @@ class VPN(object):
# XXX we try to bring the firewall up
if IS_LINUX:
- firewall_up = self._launch_firewall()
+ gateways = vpnproc.getGateways()
+ firewall_up = self._launch_firewall(gateways)
if not firewall_up:
logger.error("Could not bring firewall up, "
"aborting openvpn launch.")
@@ -208,10 +209,13 @@ class VPN(object):
self._pollers.extend(poll_list)
self._start_pollers()
- def _launch_firewall(self):
+ def _launch_firewall(self, gateways):
"""
Launch the firewall using the privileged wrapper.
+ :param gateways:
+ :type gateways: list
+
:returns: True if the exitcode of calling the root helper in a
subprocess is 0.
:rtype: bool
@@ -223,7 +227,7 @@ class VPN(object):
# XXX could check that the iptables rules are in place.
BM_ROOT = linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT
- exitCode = subprocess.call([BM_ROOT, "firewall", "start"])
+ exitCode = subprocess.call([BM_ROOT, "firewall", "start"] + gateways)
return True if exitCode is 0 else False
def _kill_if_left_alive(self, tries=0):
@@ -861,6 +865,12 @@ class VPNProcess(protocol.ProcessProtocol, VPNManager):
logger.debug("Running VPN with command: {0}".format(command))
return command
+ def getGateways(self):
+ gateways = self._launcher.get_gateways(
+ self._eipconfig, self._providerconfig)
+ print "getGateways --> ", gateways
+ return gateways
+
# shutdown
def killProcess(self):