summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-17 20:38:24 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-17 20:39:37 +0200
commit2d47eb1eba4fb19f6ee9d424fcfd90b08f38f060 (patch)
treed2708a4ac3c5bfd4f3d3aa6acec82c44b5d1107b /src
parent9bcdb58c13b7094a79ae2855a5682f29facab51d (diff)
downloadvyos-1x-2d47eb1eba4fb19f6ee9d424fcfd90b08f38f060.tar.gz
vyos-1x-2d47eb1eba4fb19f6ee9d424fcfd90b08f38f060.zip
pppoe: dhcpv6-pd: T421: stop service when config is removed
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index ab96211ac..e46d52d19 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -191,14 +191,16 @@ def generate(pppoe):
script_pppoe_ip_up = f'/etc/ppp/ip-up.d/1000-vyos-pppoe-{intf}'
script_pppoe_ip_down = f'/etc/ppp/ip-down.d/1000-vyos-pppoe-{intf}'
script_pppoe_ipv6_up = f'/etc/ppp/ipv6-up.d/1000-vyos-pppoe-{intf}'
+ config_wide_dhcp6c = f'/run/dhcp6c/dhcp6c.{intf}.conf'
config_files = [config_pppoe, script_pppoe_pre_up, script_pppoe_ip_up,
- script_pppoe_ip_down, script_pppoe_ipv6_up]
+ script_pppoe_ip_down, script_pppoe_ipv6_up, config_wide_dhcp6c]
# Shutdown DHCPv6 prefix delegation client
- if pppoe['dhcpv6_pd']:
+ if not pppoe['dhcpv6_pd']:
cmd(f'systemctl stop dhcp6c@{intf}.service')
+
# Always hang-up PPPoE connection prior generating new configuration file
cmd(f'systemctl stop ppp@{intf}.service')
@@ -228,9 +230,10 @@ def generate(pppoe):
pppoe, trim_blocks=True, permission=0o755)
if len(pppoe['dhcpv6_pd']) > 0:
- ifname = pppoe['intf']
- pppoe['ifname'] = ifname
- render(f'/run/dhcp6c/dhcp6c.{ifname}.conf', 'dhcp-client/ipv6.tmpl', pppoe, trim_blocks=True)
+ # ipv6.tmpl relies on ifname - this should be made consitent in the
+ # future better then double key-ing the same value
+ pppoe['ifname'] = intf
+ render(config_wide_dhcp6c, 'dhcp-client/ipv6.tmpl', pppoe, trim_blocks=True)
return None