summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2018-08-26 11:27:54 -0700
committerhagbard <vyosdev@derith.de>2018-08-26 11:27:54 -0700
commitcc584bb5ae8e701b0d8471fa675a0e44228b4ee2 (patch)
tree07fec71e2c1b68ee34b779d2d20f6e588b67b920
parentf2aaa21fb909933246f3340240dc17d05c5f9695 (diff)
downloadvyos-1x-cc584bb5ae8e701b0d8471fa675a0e44228b4ee2.tar.gz
vyos-1x-cc584bb5ae8e701b0d8471fa675a0e44228b4ee2.zip
T427: changed option listen-port to only port
-rw-r--r--interface-definitions/wireguard.xml2
-rwxr-xr-xsrc/conf_mode/wireguard.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/interface-definitions/wireguard.xml b/interface-definitions/wireguard.xml
index 335749e35..cf25124fa 100644
--- a/interface-definitions/wireguard.xml
+++ b/interface-definitions/wireguard.xml
@@ -42,7 +42,7 @@
<constraintErrorMessage>interface description is too long (limit 100 characters)</constraintErrorMessage>
</properties>
</leafNode>
- <leafNode name="listen-port">
+ <leafNode name="port">
<properties>
<help>Local port number to accept connections</help>
<constraint>
diff --git a/src/conf_mode/wireguard.py b/src/conf_mode/wireguard.py
index 0324e12a2..9848914e3 100755
--- a/src/conf_mode/wireguard.py
+++ b/src/conf_mode/wireguard.py
@@ -89,8 +89,8 @@ def get_config():
if c.exists(cnf + ' address'):
config_data['interfaces'][intfc]['addr'] = c.return_values(cnf + ' address')
### listen port
- if c.exists(cnf + ' listen-port'):
- config_data['interfaces'][intfc]['lport'] = c.return_value(cnf + ' listen-port')
+ if c.exists(cnf + ' port'):
+ config_data['interfaces'][intfc]['lport'] = c.return_value(cnf + ' port')
### description
if c.exists(cnf + ' description'):
config_data['interfaces'][intfc]['descr'] = c.return_value(cnf + ' description')
@@ -227,7 +227,7 @@ def apply(c):
def configure_interface(c, intf):
wg_config = {
'interface' : intf,
- 'listen-port' : 0,
+ 'port' : 0,
'private-key' : '/config/auth/wireguard/private.key',
'peer' :
{
@@ -248,7 +248,7 @@ def configure_interface(c, intf):
## optional settings
# listen-port
if c['interfaces'][intf]['lport']:
- wg_config['listen-port'] = c['interfaces'][intf]['lport']
+ wg_config['port'] = c['interfaces'][intf]['lport']
## endpoint
if c['interfaces'][intf]['peer'][p]['endpoint']:
@@ -260,7 +260,7 @@ def configure_interface(c, intf):
### assemble wg command
cmd = "sudo wg set " + intf
- cmd += " listen-port " + str(wg_config['listen-port'])
+ cmd += " listen-port " + str(wg_config['port'])
cmd += " private-key " + wg_config['private-key']
cmd += " peer " + wg_config['peer']['pubkey']
cmd += " allowed-ips "