Skip to content

Commit

Permalink
Follow vpnc-script's route call more closely
Browse files Browse the repository at this point in the history
  • Loading branch information
gmacon committed Jun 10, 2020
1 parent ea8235d commit e03de6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vpn_slice/mac.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import re
import subprocess
from ipaddress import ip_network
from ipaddress import ip_network, ip_interface

from .posix import PosixProcessProvider
from .provider import RouteProvider
Expand Down Expand Up @@ -102,8 +102,8 @@ def set_link_info(self, device, state, mtu=None):
self._ifconfig(*args)

def add_address(self, device, address):
address = ip_interface(address)
if address.version == 6:
family = 'inet6'
self._ifconfig(device, 'inet6', address)
else:
family = 'inet'
self._ifconfig(device, family, ip_network(address), address)
self._ifconfig(device, 'inet', address.ip, address.ip, 'netmask', '255.255.255.255')

0 comments on commit e03de6a

Please sign in to comment.