From: Donald Sharp Date: Wed, 28 Nov 2018 23:46:36 +0000 (-0500) Subject: bgpd: interface based peers should automatically override it's peer group X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fcdae3bc9d7d9c6796dcdd6c1b20bd4192bdff66;p=matthieu%2Ffrr.git bgpd: interface based peers should automatically override it's peer group When a interface based peer is setup and if it is part of a peer group we should ignore this and just use the PEER_FLAG_CAPABILITY_ENHE no matter what. Signed-off-by: Donald Sharp Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 844bfa8456..46d94f326a 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2852,7 +2852,7 @@ static int peer_conf_interface_get(struct vty *vty, const char *conf_if, if (!CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE)) { SET_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE); SET_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE); - UNSET_FLAG(peer->flags_override, PEER_FLAG_CAPABILITY_ENHE); + SET_FLAG(peer->flags_override, PEER_FLAG_CAPABILITY_ENHE); } if (peer_group_name) { diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 8e25463e87..5036b63573 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7074,14 +7074,17 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp, /* capability extended-nexthop */ if (peergroup_flag_check(peer, PEER_FLAG_CAPABILITY_ENHE)) { - if (CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE)) - vty_out(vty, - " no neighbor %s capability extended-nexthop\n", - addr); - else - vty_out(vty, - " neighbor %s capability extended-nexthop\n", - addr); + if (!peer->conf_if) { + if (CHECK_FLAG(peer->flags_invert, + PEER_FLAG_CAPABILITY_ENHE)) + vty_out(vty, + " no neighbor %s capability extended-nexthop\n", + addr); + else + vty_out(vty, + " neighbor %s capability extended-nexthop\n", + addr); + } } /* dont-capability-negotiation */ diff --git a/tests/bgpd/test_peer_attr.py b/tests/bgpd/test_peer_attr.py index 7a4dd2b04a..1ab1e46c2e 100644 --- a/tests/bgpd/test_peer_attr.py +++ b/tests/bgpd/test_peer_attr.py @@ -9,7 +9,7 @@ class TestFlag(frrtest.TestMultiOut): TestFlag.okfail('peer\\advertisement-interval') TestFlag.okfail('peer\\capability dynamic') TestFlag.okfail('peer\\capability extended-nexthop') -TestFlag.okfail('peer\\capability extended-nexthop') +#TestFlag.okfail('peer\\capability extended-nexthop') TestFlag.okfail('peer\\description') TestFlag.okfail('peer\\disable-connected-check') TestFlag.okfail('peer\\dont-capability-negotiate')