diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-25 20:35:55 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-25 20:37:12 +0200 |
commit | 68ad8752a4a5b57addc7bd3d2db0f464acb79b50 (patch) | |
tree | 033d8e4af4793966a6e25aa641a26811f9fe9f41 | |
parent | 85d6c8f7c62f7a52fbae5d0eaddd1f8803bd8014 (diff) | |
download | vyos-1x-68ad8752a4a5b57addc7bd3d2db0f464acb79b50.tar.gz vyos-1x-68ad8752a4a5b57addc7bd3d2db0f464acb79b50.zip |
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.
-rwxr-xr-x | src/etc/ppp/ip-up.d/99-vyos-pppoe-callback | 18 |
1 files changed, 4 insertions, 14 deletions
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) |