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

upnp: T4613: Verify listen key in dictionary #1475

Merged
merged 1 commit into from
Aug 16, 2022
Merged

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Aug 16, 2022

Change Summary

There is no check if listen exists in the dictionary, fix it
Fix odd ValueHelp format
Delete unused imports

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

upnp

Proposed changes

How to test

Before fix:

set service upnp rule 10 action 'allow'
set service upnp rule 10 external-port-range '1024-65535'
set service upnp rule 10 internal-port-range '1024-65535'
set service upnp rule 10 ip '10.0.0.1'
set service upnp wan-interface 'eth0'

commit
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/service_upnp.py", line 152, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/service_upnp.py", line 116, in verify
    for listen_if_or_addr in upnpd['listen']:
KeyError: 'listen'



[[service upnp]] failed

After fix:

vyos@r1# commit
[ service upnp ]
Listen address or interface is required!

[[service upnp]] failed
Commit failed
[edit]
vyos@r1# 

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

There is no check if 'listen' is exist in the dictionary, fix it
Fix odd ValueHelp format
@c-po c-po merged commit 1f88097 into vyos:current Aug 16, 2022
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