Repository navigation
Conversation
- frr_bgp_neighbor: replace the removed 'multiprotocol' toggle with the 'family' multi-select (opnsense/plugins f7a268594). 'family' defaults to the family of the neighbor IP, like the os-frr migration does. 'multi_protocol: true' still works and maps to both families. - frr_bgp_route_map: os-frr groups as-path and community lists by number and prefix-lists by name and the API returns only one entry per group (opnsense/plugins 9cc363edc). Compare the linked groups instead of the entry UUIDs, so linking several entries of one group no longer reports 'changed' on every run. Diffs show descriptions/names instead of UUIDs. - frr_bgp_peer_group: validate the name like os-frr does now (opnsense/plugins c8e6e93d8). - docs: note the changes and the stricter network/router-id validation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pqWdGsBoRhwRi6rcxCFmc
Replace the AS numbers 1337, 1338 and 1339 in the BGP tests, the BGP cleanup and the BGP docs examples with 64496, 64497 and 64498 from the range reserved for documentation (RFC 5398). 1337 is an assigned public AS number. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pqWdGsBoRhwRi6rcxCFmc
|
Note: I will have to take some time reviewing this PR as there are a lot of changes.. Hope I find time for it sometime soon. |
…s-frr 2.0 The BGP neighbor and process models of os-frr 2.0 (OPNsense 26.7) carry options the modules had no parameter for, so they could only be set in the WebUI and were invisible to a run - a neighbor's 'Soft reconfiguration inbound' being the one that made us look. frr_bgp_neighbor: local_as, soft_reconfiguration_inbound, bfd_strict, remove_private_as, allow_as_in, attribute_unchanged, capabilities and peer_group. The peer group is given by name and resolved to its uuid like the prefix-lists and route-maps; 'remove_private_as' takes the option-names of the model and maps them to the FRR arguments the API stores; 'bfd_strict' without 'bfd' fails before the API call. frr_bgp_general: enforce_first_as, bestpath, maximum_paths and maximum_paths_ibgp. 'enforce_first_as' defaults to true like the model, so an existing configuration reads back unchanged. All of them are change-fields, so the full state is enforced as for every other option of these modules. The 26.7 model also dropped 'multiprotocol' for 'family', which the released module cannot read at all. That adaptation is the subject of O-X-L#487 by nerrehmit; this commit carries the same change so it can be tested on 26.7 on its own, and will be rebased onto O-X-L#487 once that is merged. Tests: a mocked BgpController reproducing the 26.7 response shape, unit-tests for both modules (translation of the new fields, posted payload, idempotency, every field changing on its own, the peer-group lookup, bfd_strict guard, check mode, list output) and the functional tests extended with the new options, a peer-group link and the failure cases. Docs tables and examples updated.
|
Thanks for this - we hit the same I have opened #504 on top of it: the remaining options of the os-frr 2.0 model that the modules had no parameter for ( |
|
/review (FYI: Just testing the Review-Bot I am just adding) |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
/change-summary |
PR Change Summary
Generated by /change-summary |
Before: on OPNsense 26.7 (os-frr 2.0)
frr_bgp_neighborfails on every existing neighbor with "Failed to translate API entry ... Failed field: 'multiprotocol'".frr_bgp_route_mapreportschangedon every run when it links several entries of one as-path, community or prefix-list, or any entry but the first one of a list.After: neighbors take the new
familyoption (ipv4,ipv6or both), and the route-map module compares the linked lists, so it settles after the first run.Upstream changes behind each fix
frr_bgp_neighborfamilyadded (list ofipv4/ipv6). It defaults to the family of the neighbor IP, as the os-frr migration does.multi_protocolis kept as a deprecated shortcut:truemeans both families, and it can't be combined withfamilymultiprotocolremoved,familyadded as a required multi-selectfrr_bgp_route_mapas_path_list,community_listandprefix_listare compared by the lists they link (as-path/community number, prefix-list name), not by entry UUID. Diffs show descriptions and names instead of UUIDsGroupedModelRelationField, so the API returns only the first entry of each list as selectedfrr_bgp_peer_groupnameis validated as^[a-zA-Z0-9._-]{1,64}$The other link changes need no change in the collection. Prefix-lists and route-maps used by neighbors, peer groups and redistributions also became grouped, but those modules already link the first entry of a list, which is the entry the API now reports. This was checked on a 26.7.7 box.
How
frr_bgp_neighborsetsfamilyincheck()before matching.frr_bgp_route_mapresolves the given entries to UUIDs as before. If the resulting lists are the same as the stored ones, it keeps the stored UUIDs, so nothing is sent. FRR itself has always rendered these links per list (match as-path <number>,match ip address prefix-list <name>), on 26.1 too, so this changes no behavior there either.Checked
frr_bgp_*playbooks pass, also in check mode. Onlatest,frr_bgp_neighborfails on the same box.frr_bgp_general,frr_bgp_neighborandfrr_bgp_peer_groupwere rerun unmodified on 26.7.7: all pass, also in check mode.family,multi_protocolmatching both families, andfamilytogether withmulti_protocolfailing. Further new tests cover route-maps that link two prefix-list entries, two as-paths of one number, or only the second community-list entry of a number. All three "nothing changed" checks fail onlatestagainst 26.7.7 and pass with this change.frr_bgp_neighbor, whic 8000 h can't read the missingfamilyfield.