Permalink
Browse files

T949: config issue when creating multiple wg interfaces at the same t…

…ime.
  • Loading branch information...
hagbard-01 committed Nov 2, 2018
1 parent c4c183a commit 2ad8fa385cefa1acbe75b8ca22a4183b00edf7de
Showing with 3 additions and 8 deletions.
  1. +3 −8 src/conf_mode/wireguard.py
@@ -295,18 +295,13 @@ def configure_interface(c, intf):
os.remove(psk_file)
def add_addr(intf, addr):
# see https://phabricator.vyos.net/T949
ret = subprocess.call(['ip a a dev ' + intf + ' ' + addr + ' &>/dev/null'], shell=True)
if ret != 0:
raise ConfigError('Can\'t set IP ' + addr + ' on ' + intf)
else:
sl.syslog(sl.LOG_NOTICE, "ip a a dev " + intf + " " + addr)
sl.syslog(sl.LOG_NOTICE, "ip a a dev " + intf + " " + addr)
def del_addr(intf, addr):
ret = subprocess.call(['ip a d dev ' + intf + ' ' + addr + ' &>/dev/null'], shell=True)
if ret != 0:
raise ConfigError('Can\'t delete IP ' + addr + ' on ' + intf)
else:
sl.syslog(sl.LOG_NOTICE, "ip a d dev " + intf + " " + addr)
sl.syslog(sl.LOG_NOTICE, "ip a d dev " + intf + " " + addr)
if __name__ == '__main__':
try:

0 comments on commit 2ad8fa3

Please sign in to comment.