-
Notifications
You must be signed in to change notification settings - Fork 831
Fixes bug 5362, use local initiator IP for BGP neighbor as update-sou… #5531
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,7 +138,9 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} | |
| {% if 'disable_connected_check' in neighbor and neighbor.disable_connected_check == '1' %} | ||
| neighbor {{ neighbor.address }} disable-connected-check | ||
| {% endif %} | ||
| {% if ':' not in neighbor.address and 'updatesource' in neighbor and neighbor.updatesource != '' %} | ||
| {% if 'localip' in neighbor and neighbor.localip != '' %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at a first glance I would expect we can trust the validation here, in which case we shouldn't have to duplicate the logic in the template.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is duplicates validation. uupdate-source could be both set by both updatesource and localip field. Validation on UI/API makes sure that only of them is set. However still in template we need to check which one is set to use correct variable. Additionally later on there is additional logic involving updatesource field and IPv6 which I didn't want to change, as I believe may be not fully correct. There could bnothing wrong with setting update-source parameter for ipv6 neighbor and it prevents such setting - next thing to verify. |
||
| neighbor {{ neighbor.address }} update-source {{ neighbor.localip }} | ||
| {% elif ':' not in neighbor.address and 'updatesource' in neighbor and neighbor.updatesource != '' %} | ||
| neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }} | ||
| {% endif %} | ||
| {% if ':' in neighbor.address and 'linklocalinterface' in neighbor and neighbor.linklocalinterface != '' %} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.opnsense.org/development/frontend/models_constraints.html#adding-constraints
Maybe this could be done with a SingleSelectConstraint
https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/SingleSelectConstraint.php
CC @fichtner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sure. this beats documenting things that people won't read regarding updating help texts we can easily avoid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing out constraints, working on that