summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorPascal Mathis <mail@pascalmathis.com>2018-05-19 22:10:48 +0200
committerPascal Mathis <mail@pascalmathis.com>2018-05-27 19:41:23 +0200
commit598ce6bd70427129b61f417f87be93d830496c7f (patch)
treeff6d1778446de8059596b63e76a2f59756d96aaa /lib/command.c
parentf7fba3423bbbb1cb18c4285609bf00523e539ebd (diff)
bgpd: Improve group overrides for AF flags
The current implementation for overriding peer-group configuration on a peer member consists of several bandaids, which introduce more issues than they fix. A generic approach for implementing peer-group overrides for address-family flags is clearly missing. This commit implements a generic and sane approach to overriding peer-group configuration on a peer-member. A separate peer attribute called 'af_flags_override' which was introduced in 04e1c5b is being used to keep track of all address-family flags, storing whether the configuration is being inherited from the parent-group or overridden. All address-family flags are being supported by this implementation (note: flags, not filters/maps) except 'send-community', which currently breaks due to having the three flags enabled by default, which is not being properly handled within this commit; all flags are supposed to have an 'off'/'false' state by default. In the interest of readability and comprehensibility, the flag 'send-community' is being fixed in a separate commit. The following rules apply when looking at the new peer-group override implementation this commit provides: - Each peer-group can enable every flag (except the limitations noted above), which gets automatically inherited to all members. - Each peer can enable each flag independently and/or modify their value, if available. (e.g.: weight <value>) - Each command executed on a neighbor/peer gets explicitely set as an override, so even when the peer-group has the same kind of configuration, both will show up in 'show running-configuration'. - Executing 'no <command>' on a peer will remove the peer-specific configuration and make the peer inherit the configuration from the peer-group again. - Executing 'no <command>' on a peer-group will only remove the flag from the peer-group, however not from peers explicitely setting that flag. This guarantees a clean implementation which does not break, even when constantly messing with the flags of a peer-group. The same behavior is present in Cisco devices, so people familiar with those should feel safe when dealing with FRRs peer-groups. The only restriction that now applies is that single peer cannot disable a flag which was set by a peer-group, because 'no <command>' is already being used for disabling a peer-specific override. This is not supported by any known vendor though, would require many specific edge-cases and magic comparisons and will most likely only end up confusing the user. Additionally, peer-groups should only contain flags which are being used by all peer members. Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
Diffstat (limited to 'lib/command.c')
0 files changed, 0 insertions, 0 deletions