From 68ad8752a4a5b57addc7bd3d2db0f464acb79b50 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 25 Apr 2022 20:35:55 +0200 Subject: pppoe: T4391: bugfix IPv6 DHCP-PD not working after reboot When VyOS is booting and an interface is brought up (PPPoE) which requires a user callback script that is executed asynchronously when the interface is up we can not use Config(). The problem is, Config() is not available when the system starts and the initial commit is still processed. We need to move to ConfigTreeQuery() which was build for this exact same purpose. --- src/etc/ppp/ip-up.d/99-vyos-pppoe-callback | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/etc/ppp/ip-up.d/99-vyos-pppoe-callback') diff --git a/src/etc/ppp/ip-up.d/99-vyos-pppoe-callback b/src/etc/ppp/ip-up.d/99-vyos-pppoe-callback index 78ca09010..fa1917ab1 100755 --- a/src/etc/ppp/ip-up.d/99-vyos-pppoe-callback +++ b/src/etc/ppp/ip-up.d/99-vyos-pppoe-callback @@ -23,15 +23,9 @@ from sys import argv from sys import exit -from syslog import syslog -from syslog import openlog -from syslog import LOG_PID -from syslog import LOG_INFO - -from vyos.configquery import Config +from vyos.configquery import ConfigTreeQuery from vyos.configdict import get_interface_dict from vyos.ifconfig import PPPoEIf -from vyos.util import read_file # When the ppp link comes up, this script is called with the following # parameters @@ -46,14 +40,10 @@ if (len(argv) < 7): exit(1) interface = argv[6] -dialer_pid = read_file(f'/var/run/{interface}.pid') - -openlog(ident=f'pppd[{dialer_pid}]', facility=LOG_INFO) -syslog('executing ' + argv[0]) -conf = Config() -pppoe = get_interface_dict(conf, ['interfaces', 'pppoe'], argv[6]) +conf = ConfigTreeQuery() +_, pppoe = get_interface_dict(conf.config, ['interfaces', 'pppoe'], interface) # Update the config -p = PPPoEIf(pppoe['ifname']) +p = PPPoEIf(interface) p.update(pppoe) -- cgit v1.2.3