]> 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>
Sun, 23 Jun 2019 19:51:51 +0000 (22:51 +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 844bfa8456501d0b3ee8b11c0ea0d67f1dd90e67..46d94f326af8d6a354311d509a14457cef118026 100644 (file)
@@ -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) {
index 8e25463e87d945f935b7730c824145ab81086851..5036b63573d4791e5e7e63ac24c452528aa0a62c 100644 (file)
@@ -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 */
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')