Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T4971: Accel-ppp verify if client_ip_pool key exists in config #1822

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

sever-sever
Copy link
Member

Change Summary

If client_ip_pool not exists in the config we cannot search for it in the dictionary
dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name'])
Add check

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

pppoe-server

Proposed changes

How to test

VyOS config:

set service pppoe-server authentication mode 'radius'
set service pppoe-server authentication radius server 192.168.122.14 key 'vyos-secret'
set service pppoe-server interface eth1

Before fix:


Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/service_pppoe-server.py", line 116, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/service_pppoe-server.py", line 62, in verify
    verify_accel_ppp_base_service(pppoe)
  File "/usr/lib/python3/dist-packages/vyos/configverify.py", line 424, in verify_accel_ppp_base_service
    for _, v in config['client_ip_pool']['name'].items():
KeyError: 'client_ip_pool'



[[service pppoe-server]] failed
Commit failed
[edit]
vyos@r14#

After fix (expected failed as gateway is not configured):

vyos@r14# commit
[ service pppoe-server ]
Server requires gateway-address to be configured!

[[service pppoe-server]] failed
Commit failed
[edit]
vyos@r14# 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

If 'client_ip_pool' not exists in config we cannot search it
in the dictionary
  dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name'])
Add check
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team February 15, 2023 15:54
@c-po c-po merged commit c4d26a3 into vyos:current Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants