[security/tinc] Enable usage of no, one or several addresses per hosts#2110
Merged
Conversation
AdSchellevis
requested changes
Nov 14, 2020
| result.append('AddressFamily=any') | ||
| if 'address' in self._payload: | ||
| addresses = self._payload['address'].split(',') | ||
| for address in addresses: |
Member
There was a problem hiding this comment.
can be simplified:
for address in self._payload['address'].split(','):
addresses isn't used anywhere else.
It's probably better to move the functionality to NetwConfObject. get_addresses() in which case you could iterate always over the get_addresses() and ditch the if as well
Contributor
Author
There was a problem hiding this comment.
Did so, but this part shouldn't have been, anyway...
Undone. Took care of your comment in next code block.
| result.append('Address=%(address)s %(port)s'%self._payload) | ||
| if 'address' in self._payload: | ||
| addresses = self._payload['address'].split(',') | ||
| for address in addresses: |
Contributor
Author
There was a problem hiding this comment.
Was micmic of existing code for subnets...
Reworked both this way.
| <ValidationMessage>Please specify a valid hostname.</ValidationMessage> | ||
| </hostname> | ||
| <extaddress type="TextField"> | ||
| <Required>Y</Required> |
Member
There was a problem hiding this comment.
I think we could also use a HostnameField in combination with a tokeniser in the form, in which case you wouldn't need to explain the split character.
Every generated config files last line ends with a newline
Member
This was referenced Jan 14, 2021
AdSchellevis
pushed a commit
that referenced
this pull request
Jan 14, 2021
windgmbh
pushed a commit
to windgmbh/opnsense-plugins
that referenced
this pull request
Feb 4, 2021
In switch mode the subnet field is empty, thus the 'subnet' key does not exist in the '_payload' dictionary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All three situations are legit, both for local and remote hosts.