]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: interface based peers should automatically override it's peer group
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 23:46:36 +0000 (18:46 -0500)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 19 Jun 2019 13:47:54 +0000 (16:47 +0300)
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 <sharpd@cumulusnetworks.com>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_vty.c
bgpd/bgpd.c
tests/bgpd/test_peer_attr.py

index bdac903b99f2c6d739fc365e5386b70d31b47cd6..ff855b5ceaf743901129338261159c2afacbeb5e 100644 (file)
@@ -2872,7 +2872,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) {
index 94aadda3d689c80b34fbcc76795cca8978c00e07..fd644e5fb0dc17f1f3c197c9c8ec7db2cb590f2e 100644 (file)
@@ -6954,14 +6954,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 */
index 7a4dd2b04a2e242cd46dd338467508a12f9addc6..1ab1e46c2e27c658814818e40ad967543d23c84f 100644 (file)
@@ -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')