]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgpd.h
bgpd: Implement group-overrides for peer flags
authorPascal Mathis <mail@pascalmathis.com>
Mon, 11 Jun 2018 17:49:20 +0000 (19:49 +0200)
committerPascal Mathis <mail@pascalmathis.com>
Thu, 14 Jun 2018 16:55:18 +0000 (18:55 +0200)
commit9fb964de21c740a2e253a5527a9a037eed8c8378
treec521eb10d8ace752964c5a74f3fd78d317564689
parent0d0ca0bb3462efc19d1f2e6d770413f78b022e74
bgpd: Implement group-overrides for peer flags

The current implementation of peer flags (e.g. shutdown, passive, ...)
only has partial support for overriding flags of a peer-group when the
peer is a member. Often settings might get lost if the user toys around
with the peer-group configuration, which can lead to disaster.

This commit introduces the same override implementation which was
previously integrated to support proper peer flag/attribute override on
the address-family level. The code is very similar and the global
attributes now use their separate state-arrays *flags_invert* and
*flags_override*.

The test suite for BGP peer attributes was extended to also check peer
global attributes, so that the newly introduced changes are covered. An
additional feature was added which allows to test an attribute with an
*interface-peer*, which can be configured by running `neighbor IF-TEST
interface`. This was introduced so that the dynamic runtime inversion of
the `extended-nexthop` flag, which is only enabled by default for
interface peers, can also be tested.

Last but not least, two small changes have been made to the current bgpd
implementation:

- The command `strict-capability-match` can now also be set on a
peer-group, it seems like this command slipped through while
implementing peer-groups in the very past.

- The macro `COND_FLAG` was introduced inside lib/zebra.h, which now
allows to either set or unset a flag based on a condition. The syntax
for using this macro is: `COND_FLAG(flag_variable, flag, condition)`

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h
lib/zebra.h
tests/bgpd/test_peer_attr.c
tests/bgpd/test_peer_attr.py