]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #3051 from mitch-skiba/addpath_change_V1
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 13 Nov 2018 14:20:22 +0000 (09:20 -0500)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 14:20:22 +0000 (09:20 -0500)
Addpath - Reuse IDs

57 files changed:
.gitignore
babeld/babel_zebra.c
bfdd/ptm_adapter.c
bgpd/bgp_nht.c
bgpd/bgp_nht.h
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/rfapi/vnc_zebra.c
doc/developer/building-frr-for-centos6.rst
doc/developer/building-frr-for-ubuntu1804.rst
doc/developer/building-libyang.rst
doc/developer/conf.py
doc/developer/maintainer-release-build.rst
doc/developer/modules.rst
doc/developer/next-hop-tracking.rst
doc/developer/packaging-debian.rst
doc/developer/packaging.rst
doc/developer/process-architecture.rst
doc/user/installation.rst
doc/user/isisd.rst
doc/user/static.rst
doc/user/zebra.rst
eigrpd/eigrp_zebra.c
isisd/isis_lsp.c
isisd/isis_zebra.c
ldpd/lde.c
ldpd/ldp_zebra.c
lib/agentx.c
lib/zclient.c
lib/zclient.h
nhrpd/nhrp_route.c
ospf6d/ospf6_area.c
ospf6d/ospf6_zebra.c
ospfd/ospf_zebra.c
pbrd/pbr_zebra.c
pimd/pim_zebra.c
pimd/pim_zlookup.c
ripd/rip_zebra.c
ripngd/ripng_zebra.c
sharpd/sharp_zebra.c
staticd/static_zebra.c
tests/.gitignore
tests/bgpd/test_mpath.c
tests/isisd/test_isis_lspdb.c [new file with mode: 0644]
tests/isisd/test_isis_lspdb.py [new file with mode: 0644]
tests/subdir.am
tests/test_lblmgr.c
tools/etc/frr/daemons.conf
tools/frr.in
zebra/if_netlink.c
zebra/interface.c
zebra/interface.h
zebra/label_manager.c
zebra/zebra_l2.c
zebra/zebra_l2.h
zebra/zebra_rib.c
zebra/zebra_routemap.c

index ad3e3c80e02ec70399195eba172b1b7c312ba9fa..05fcd6ce4bc2edaee5a7636e5c6d133e0b940f1a 100644 (file)
@@ -27,6 +27,7 @@
 /conftest.err
 /aclocal.m4
 /libtool
+/libtool.orig
 
 /Makefile
 /Makefile.in
index 8dea1431e2eb0429007bd1ac35128ab8043d1033..e909f8ea7a4e81880654fe0cf7d13747772ba2ea 100644 (file)
@@ -237,7 +237,7 @@ babel_zebra_connected (struct zclient *zclient)
 
 void babelz_zebra_init(void)
 {
-    zclient = zclient_new_notify(master, &zclient_options_default);
+    zclient = zclient_new(master, &zclient_options_default);
     zclient_init(zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
 
     zclient->zebra_connected = babel_zebra_connected;
index a5fae3383cd7248ba0994f318e2e877dd90f283f..f9c7c16fb1349e860c981ba223ae8e4336ed6bc7 100644 (file)
@@ -381,6 +381,21 @@ static int _ptm_msg_read(struct stream *msg, int command,
                if (bpc->bpc_has_localif) {
                        STREAM_GET(bpc->bpc_localif, msg, ifnamelen);
                        bpc->bpc_localif[ifnamelen] = 0;
+
+                       /*
+                        * IPv6 link-local addresses must use scope id,
+                        * otherwise the session lookup will always fail
+                        * and we'll have multiple sessions showing up.
+                        *
+                        * This problem only happens with single hop
+                        * since it is not possible to have link-local
+                        * address for multi hop sessions.
+                        */
+                       if (bpc->bpc_ipv4 == false
+                           && IN6_IS_ADDR_LINKLOCAL(
+                                      &bpc->bpc_peer.sa_sin6.sin6_addr))
+                               bpc->bpc_peer.sa_sin6.sin6_scope_id =
+                                       ptm_bfd_fetch_ifindex(bpc->bpc_localif);
                }
        }
 
@@ -566,7 +581,7 @@ static void bfdd_zebra_connected(struct zclient *zc)
 
 void bfdd_zclient_init(struct zebra_privs_t *bfdd_priv)
 {
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        assert(zclient != NULL);
        zclient_init(zclient, ZEBRA_ROUTE_BFD, 0, bfdd_priv);
 
index 8aa7798af4254bd4227dcfefc2f35b147a8325e2..0dce96f43240c5703dc52548a118ed9f318498f0 100644 (file)
@@ -838,3 +838,48 @@ void bgp_nht_register_nexthops(struct bgp *bgp)
                }
        }
 }
+
+void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)
+{
+       struct bgp *bgp;
+       struct bgp_node *rn;
+       struct bgp_nexthop_cache *bnc;
+       struct nexthop *nhop;
+       struct interface *ifp;
+       struct prefix p;
+
+       if (peer->ifp)
+               return;
+
+       bgp = peer->bgp;
+
+       if (!bgp->nexthop_cache_table[AFI_IP6])
+               return;
+
+       if (!sockunion2hostprefix(&peer->su, &p)) {
+               if (BGP_DEBUG(nht, NHT))
+                       zlog_debug("%s: Unable to convert prefix to sockunion",
+                                  __PRETTY_FUNCTION__);
+               return;
+       }
+
+       if (p.family != AF_INET6)
+               return;
+       rn = bgp_node_lookup(bgp->nexthop_cache_table[AFI_IP6], &p);
+
+       bnc = bgp_nexthop_get_node_info(rn);
+       if (!bnc)
+               return;
+
+       if (peer != bnc->nht_info)
+               return;
+
+       for (nhop = bnc->nexthop; nhop; nhop = nhop->next) {
+               ifp = if_lookup_by_index(nhop->ifindex,
+                                        nhop->vrf_id);
+               zclient_send_interface_radv_req(zclient,
+                                               nhop->vrf_id,
+                                               ifp, true,
+                                               BGP_UNNUM_DEFAULT_RA_INTERVAL);
+       }
+}
index 96dd9155964c10baab84b6fb2a6dd34749c55b87..7daae93b25179dde501824ff8c38f7cf0e7198b9 100644 (file)
@@ -88,4 +88,13 @@ extern void path_nh_map(struct bgp_path_info *path,
  */
 extern void bgp_nht_register_nexthops(struct bgp *bgp);
 
+/*
+ * When we have the the PEER_FLAG_CAPABILITY_ENHE flag
+ * set on a peer *after* it has been brought up we need
+ * to notice and setup the interface based RA,
+ * this code can walk the registered nexthops and
+ * register the important ones with zebra for RA.
+ */
+extern void bgp_nht_register_enhe_capability_interfaces(struct peer *peer);
+
 #endif /* _BGP_NHT_H */
index 50b790eb118a4ddd59491546133c94c8cd87ca3c..62f977eee14b370b0c8d873217383412252bc535 100644 (file)
@@ -2574,7 +2574,7 @@ void bgp_zebra_init(struct thread_master *master, unsigned short instance)
        zclient_num_connects = 0;
 
        /* Set default values. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
        zclient->zebra_connected = bgp_zebra_connected;
        zclient->router_id_update = bgp_router_id_update;
index f30d3ede893aad97206e7074e939fc4c08cbc039..32bbb78ef3ebb90ad8d4257b95cb3dea715101eb 100644 (file)
@@ -3939,6 +3939,9 @@ static int peer_flag_modify(struct peer *peer, uint32_t flag, int set)
                return 0;
        }
 
+       if (set && flag == PEER_FLAG_CAPABILITY_ENHE)
+               bgp_nht_register_enhe_capability_interfaces(peer);
+
        /*
         * Update peer-group members, unless they are explicitely overriding
         * peer-group configuration.
@@ -3962,6 +3965,9 @@ static int peer_flag_modify(struct peer *peer, uint32_t flag, int set)
                /* Update flag on peer-group member. */
                COND_FLAG(member->flags, flag, set != member_invert);
 
+               if (set && flag == PEER_FLAG_CAPABILITY_ENHE)
+                       bgp_nht_register_enhe_capability_interfaces(member);
+
                /* Execute flag action on peer-group member. */
                if (action.type == peer_change_reset)
                        peer_flag_modify_action(member, flag);
index 97d520eda76ce3d6d553296028815866ee9a75b6..a43cf1f6a98ccac4e8f182fab16b485b87e7d5eb 100644 (file)
@@ -913,7 +913,7 @@ extern struct zebra_privs_t bgpd_privs;
 void vnc_zebra_init(struct thread_master *master)
 {
        /* Set default values. */
-       zclient_vnc = zclient_new_notify(master, &zclient_options_default);
+       zclient_vnc = zclient_new(master, &zclient_options_default);
        zclient_init(zclient_vnc, ZEBRA_ROUTE_VNC, 0, &bgpd_privs);
 
        zclient_vnc->redistribute_route_add = vnc_zebra_read_route;
index 5f9ce705f222a6a283487993bc419b2ab6e95c14..c57573cb9fe2ea7357ae5dbc1b933b7879f8d7a0 100644 (file)
@@ -244,7 +244,7 @@ Load the modifed sysctl's on the system:
 Add init.d startup files
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. code-block::
+.. code-block:: shell
 
    sudo install -p -m 755 redhat/frr.init /etc/init.d/frr
    sudo chkconfig --add frr
@@ -252,13 +252,13 @@ Add init.d startup files
 Enable FRR daemon at startup
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. code-block::
+.. code-block:: shell
 
    sudo chkconfig frr on
 
 Start FRR manually (or reboot)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. code-block::
+.. code-block:: shell
 
    sudo /etc/init.d/frr start
index 2d1edc063d6042708e84ecfdecba05a55ead70e7..e69ded8f73912d05b6574c4c17eff044b70e5663 100644 (file)
@@ -115,7 +115,7 @@ Create empty FRR configuration files
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Although not strictly necessary, it's good practice to create empty
-configuration files _before_ starting FRR. This assures that the permissions 
+configuration files _before_ starting FRR. This assures that the permissions
 are correct. If the files are not already present, FRR will create them.
 
 It's also important to consider _which_ files to create. FRR supports writing
index 9757ad454eaeb4ece80bfc099d77c90002217ff9..005b6ba78680a49ac39d13e226934c8d2e69bded 100644 (file)
@@ -40,23 +40,3 @@ When building libyang on CentOS 6, it's also necessary to pass the
 Note: please check the `libyang build requirements
 <https://github.com/CESNET/libyang/blob/master/README.md#build-requirements>`_
 first.
-
-Libyang uses loadable libraries an YANG modules.  It supports
-environment variables to allow overriding the load paths for each of
-these. With FRR, this override currently must be done at the time of
-running FRR's configure command using new options. The new options are:
-
-.. code-block:: shell
-
-   --with-yangmodelsdir=DIR
-                          yang models directory (${datarootdir}/yang)
-   --with-libyang-pluginsdir=DIR
-                          yangmodule plugins directory
-                          (${libdir}/frr/libyang_plugins)
-
-an example which uses the compile directory is:
-
-.. code-block:: shell
-
-   ./configure --with-libyang-pluginsdir="`pwd`/yang/libyang_plugins/.libs" \
-          --with-yangmodelsdir="`pwd`/yang"
index 61253c4b2f4ef48c3b267d2ec196dcaeda5a6e05..254c9f6bfc19a1f0141bd7a05ba59f009d48805b 100644 (file)
@@ -131,7 +131,7 @@ language = None
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', 'building-libyang.rst']
 
 # The reST default role (used for this markup: `text`) to use for all
 # documents.
index 907bd14ee67dc2c12166f0dcf145024a07c009ac..85aaa5365aa51bb09b92e151d55451893cb533ea 100644 (file)
@@ -1,5 +1,5 @@
-Release Build Procedure for FRR maintainers
-=========================================================
+Release Build Procedure for FRR Maintainers
+===========================================
 
 1. Rename branch (if needed)
 
index bde7682e4e30bd740c602a60cd69bdfcaa8f84d0..99c79462abd57b6c721c808241f7ab40af0d50b6 100644 (file)
@@ -103,9 +103,9 @@ standard entry point for loadable modules.
 Command line parameters
 -----------------------
 
-Command line parameters can be passed directly to a module by appending a 
-colon to the module name when loading it, e.g. ``-M mymodule:myparameter``. 
-The text after the colon will be accessible in the module's code through 
+Command line parameters can be passed directly to a module by appending a
+colon to the module name when loading it, e.g. ``-M mymodule:myparameter``.
+The text after the colon will be accessible in the module's code through
 ``THIS_MODULE->load_args``. For example, see how the format parameter is
 configured in the ``zfpm_init()`` function inside ``zebra_fpm.c``.
 
index e6484102a8a8e91dd9be61b16e4a51884a043549..a9af5e749cd1dd0819933d32ac3e1d83219f9dd4 100644 (file)
@@ -269,7 +269,7 @@ RNH table::
     O   O
        / \
       O   O
-   
+
    struct rnh
    {
      uint8_t flags;
index 4ea784c0fcdf86196911f4869939d7481aa4470b..c812a38212ecff3c467a98c04e9b47b81422fb7d 100644 (file)
@@ -1,5 +1,5 @@
-Debian
-======
+Packaging Debian
+================
 
 (Tested on Ubuntu 12.04, 14.04, 16.04, 17.10, 18.04, Debian 8 and 9)
 
index e9bb3a540982a5980695862f850599bd41921c9b..27e6e155fb1c25f36e9829d663f1b50be30a1bcd 100644 (file)
@@ -5,4 +5,5 @@ Packaging
 .. toctree::
    :maxdepth: 2
 
+   maintainer-release-build
    packaging-debian
index 806afa644c0992f61b35f90a19e4a1be95c1ea8c..6e0eb68188ae69dbf812a34f82e5c8890b3614f0 100644 (file)
@@ -118,7 +118,7 @@ The following diagram illustrates a simplified version of this infrastructure.
 .. todo: replace these with SVG
 .. figure:: ../figures/threadmaster-single.png
    :align: center
-   
+
    Lifecycle of a program using a single threadmaster.
 
 The series of "task" boxes represents the current ready task queue. The various
@@ -183,7 +183,7 @@ running their own ``threadmaster``-based event loop.
 .. todo: replace these with SVG
 .. figure:: ../figures/threadmaster-multiple.png
    :align: center
-   
+
    Lifecycle of a program using multiple pthreads, each running their own
    ``threadmaster``
 
index b7f0712a1b11ddbb9d1b905f1454cb98c7cc139a..9654cc2eb8a8804577b59c76f78670be0531ad5b 100644 (file)
@@ -255,6 +255,24 @@ options to the configuration script.
    Configure zebra to use `dir` for local state files, such as pid files and
    unix sockets.
 
+.. option:: --with-yangmodelsdir <dir>
+
+   Look for YANG modules in `dir` [`prefix`/share/yang]. Note that the FRR
+   YANG modules will be installed here.
+
+.. option:: --with-libyang-pluginsdir <dir>
+
+   Look for libyang plugins in `dir` [`prefix`/lib/frr/libyang_plugins].
+   Note that the FRR libyang plugins will be installed here.
+
+When it's desired to run FRR without installing it in the system, it's possible
+to configure it as follows to look for YANG modules and libyang plugins in the
+compile directory:
+.. code-block:: shell
+
+   ./configure --with-libyang-pluginsdir="`pwd`/yang/libyang_plugins/.libs" \
+               --with-yangmodelsdir="`pwd`/yang"
+
 .. _least-privilege-support:
 
 Least-Privilege Support
@@ -367,7 +385,7 @@ Additional kernel modules are also needed to support MPLS forwarding.
    appropriate value.
 
 :makevar:`VRF forwarding`
-   General information on Linux VRF support can be found in 
+   General information on Linux VRF support can be found in
    https://www.kernel.org/doc/Documentation/networking/vrf.txt. Kernel
    support for VRFs was introduced in 4.3 and improved upon through
    4.13, which is the version most used in FRR testing (as of June
@@ -403,7 +421,7 @@ Additional kernel modules are also needed to support MPLS forwarding.
    included in future kernel versions so upgrading your kernel may also
    address this issue.
 
-   
+
 Building
 ^^^^^^^^
 
index ee681858d1a4bc6f8590039fcf8c9178f6c9282f..f7607a54f72a15fbbaa40d3b403c7987e90f9ece 100644 (file)
@@ -30,14 +30,11 @@ configuration file :file:`isisd.conf`.
 ISIS router
 ===========
 
-To start ISIS process you have to specify the ISIS router. As of this
+To start the ISIS process you have to specify the ISIS router. As of this
 writing, *isisd* does not support multiple ISIS processes.
 
-.. index:: router isis WORD
-.. clicmd:: router isis WORD
-
-.. index:: no router isis WORD
-.. clicmd:: no router isis WORD
+.. index:: [no] router isis WORD
+.. clicmd:: [no] router isis WORD
 
    Enable or disable the ISIS process by specifying the ISIS domain with
    'WORD'.  *isisd* does not yet support multiple ISIS processes but you must
@@ -197,17 +194,15 @@ ISIS region
 ISIS interface
 ==============
 
-.. index:: ip router isis WORD
-.. clicmd:: ip router isis WORD
-
-.. index:: no ip router isis WORD
-.. clicmd:: no ip router isis WORD
-
 .. _ip-router-isis-word:
 
-   Activate ISIS adjacency on this interface. Note that the name
-   of ISIS instance must be the same as the one used to configure the ISIS process
-   (see command :clicmd:`router isis WORD`).
+.. index:: [no] <ip|ipv6> router isis WORD
+.. clicmd:: [no] <ip|ipv6> router isis WORD
+
+   Activate ISIS adjacency on this interface. Note that the name of ISIS
+   instance must be the same as the one used to configure the ISIS process (see
+   command :clicmd:`router isis WORD`). To enable IPv4, issue ``ip router isis
+   WORD``; to enable IPv6, issue ``ipv6 router isis WORD``.
 
 .. index:: isis circuit-type [level-1 | level-1-2 | level-2]
 .. clicmd:: isis circuit-type [level-1 | level-1-2 | level-2]
index 6755c809eb8d81788dbd8c1fe2c24b74167234e9..1705b6379e8aa9f0e1f129d09c22b737c68d8161 100644 (file)
@@ -9,7 +9,7 @@ of static routes.
 
 .. _starting-static:
 
-Starting STATIC 
+Starting STATIC
 ===============
 
 Default configuration file for *staticd* is :file:`staticd.conf`.  The typical
@@ -45,11 +45,11 @@ a static prefix and gateway.
    initial form of the command.  GATEWAY is gateway for the prefix it currently
    must match the v4 or v6 route type specified at the start of the command.
    GATEWAY can also be treated as an interface name. If the interface name
-   is ``null0`` then zebra installs a blackhole route.  TABLENO 
+   is ``null0`` then zebra installs a blackhole route.  TABLENO
    is an optional parameter for namespaces that allows you to create the
    route in a specified table associated with the vrf namespace. table will
    be rejected if you are not using namespace based vrfs.  ``nexthop-vrf``
-   allows you to create a leaked route with a nexthop in the specified VRFNAME 
+   allows you to create a leaked route with a nexthop in the specified VRFNAME
    vrf VRFNAME allows you to create the route in a specified vrf.
    ``nexthop-vrf`` cannot be currently used with namespace based vrfs
    currently as well.
index 1cfb7953d464fe382af74cf476cd9e3c6f5f80b1..dc2c95cd7ae8f445a6583bdc2e38e84530b5f2d5 100644 (file)
@@ -186,7 +186,7 @@ Standard Commands
    Enable/disable link-detect on platforms which support this. Currently only
    Linux and Solaris, and only where network interface drivers support
    reporting link-state via the ``IFF_RUNNING`` flag.
-   
+
    In FRR, link-detect is on by default.
 
 .. _link-parameters-commands:
index 3a3d6aae1223278c755c1c9f3e6a51acfc90bab5..29bd23b5141dc4212e7587fe63c3f793e814ea57 100644 (file)
@@ -116,7 +116,7 @@ void eigrp_zebra_init(void)
 {
        struct zclient_options opt = {.receive_notify = false};
 
-       zclient = zclient_new_notify(master, &opt);
+       zclient = zclient_new(master, &opt);
 
        zclient_init(zclient, ZEBRA_ROUTE_EIGRP, 0, &eigrpd_privs);
        zclient->zebra_connected = eigrp_zebra_connected;
index bb090f42edda55fef18c9956f2d8331108d1b2fb..38239d5919ccc9fec89aaa1981d810da63e994a9 100644 (file)
@@ -406,8 +406,12 @@ static void lsp_seqno_update(struct isis_lsp *lsp0)
        for (ALL_LIST_ELEMENTS_RO(lsp0->lspu.frags, node, lsp)) {
                if (lsp->tlvs)
                        lsp_inc_seqno(lsp, 0);
-               else
+               else if (lsp->hdr.rem_lifetime) {
+                       /* Purge should only be applied when the fragment has
+                        * non-zero remaining lifetime.
+                        */
                        lsp_purge(lsp, lsp0->level, NULL);
+               }
        }
 
        return;
@@ -578,29 +582,17 @@ void lsp_insert(struct isis_lsp *lsp, dict_t *lspdb)
 void lsp_build_list_nonzero_ht(uint8_t *start_id, uint8_t *stop_id,
                               struct list *list, dict_t *lspdb)
 {
-       dnode_t *first, *last, *curr;
-
-       first = dict_lower_bound(lspdb, start_id);
-       if (!first)
-               return;
-
-       last = dict_upper_bound(lspdb, stop_id);
+       for (dnode_t *curr = dict_lower_bound(lspdb, start_id);
+            curr; curr = dict_next(lspdb, curr)) {
+               struct isis_lsp *lsp = curr->dict_data;
 
-       curr = first;
-
-       if (((struct isis_lsp *)(curr->dict_data))->hdr.rem_lifetime)
-               listnode_add(list, first->dict_data);
-
-       while (curr) {
-               curr = dict_next(lspdb, curr);
-               if (curr
-                   && ((struct isis_lsp *)(curr->dict_data))->hdr.rem_lifetime)
-                       listnode_add(list, curr->dict_data);
-               if (curr == last)
+               if (memcmp(lsp->hdr.lsp_id, stop_id,
+                          ISIS_SYS_ID_LEN + 2) > 0)
                        break;
-       }
 
-       return;
+               if (lsp->hdr.rem_lifetime)
+                       listnode_add(list, lsp);
+       }
 }
 
 static void lsp_set_time(struct isis_lsp *lsp)
@@ -1306,6 +1298,13 @@ static int lsp_regenerate(struct isis_area *area, int level)
        lsp->last_generated = time(NULL);
        lsp_flood(lsp, NULL);
        for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
+               if (!frag->tlvs) {
+                       /* Updating and flooding should only affect fragments
+                        * carrying data
+                        */
+                       continue;
+               }
+
                frag->hdr.lsp_bits = lsp_bits_generate(
                        level, area->overload_bit, area->attached_bit);
                /* Set the lifetime values of all the fragments to the same
@@ -1361,7 +1360,7 @@ static int lsp_refresh(struct thread *thread)
        if ((area->is_type & level) == 0)
                return ISIS_ERROR;
 
-       if (monotime_since(&area->last_lsp_refresh_event[level - 1], NULL) < 50000L) {
+       if (monotime_since(&area->last_lsp_refresh_event[level - 1], NULL) < 100000L) {
                sched_debug("ISIS (%s): Still unstable, postpone LSP L%d refresh",
                            area->area_tag, level);
                _lsp_regenerate_schedule(area, level, 0, false,
@@ -1999,13 +1998,13 @@ void lsp_set_all_srmflags(struct isis_lsp *lsp, bool set)
 
 void lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit)
 {
-       if (!fabricd) {
+       if (!fabricd)
                lsp_set_all_srmflags(lsp, true);
-               if (circuit)
-                       isis_tx_queue_del(circuit->tx_queue, lsp);
-       } else {
+       else
                fabricd_lsp_flood(lsp);
-       }
+
+       if (circuit)
+               isis_tx_queue_del(circuit->tx_queue, lsp);
 }
 
 static int lsp_handle_adj_state_change(struct isis_adjacency *adj)
index 9363dbcedf28ec8dc2ae08c67bd933c91d20d776..101bd57cc932f0049b7b462141d56510a57e1cc6 100644 (file)
@@ -413,7 +413,7 @@ static void isis_zebra_connected(struct zclient *zclient)
 
 void isis_zebra_init(struct thread_master *master)
 {
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, PROTO_TYPE, 0, &isisd_privs);
        zclient->zebra_connected = isis_zebra_connected;
        zclient->router_id_update = isis_router_id_update_zebra;
index 4f74d93044376cc3983f64887bb04d2d5d56b0f8..2aa96546ecfb269f23c4c7011f5baf99a1f15847 100644 (file)
@@ -1627,7 +1627,7 @@ lde_address_list_free(struct lde_nbr *ln)
 static void zclient_sync_init(unsigned short instance)
 {
        /* Initialize special zclient for synchronous message exchanges. */
-       zclient_sync = zclient_new_notify(master, &zclient_options_default);
+       zclient_sync = zclient_new(master, &zclient_options_default);
        zclient_sync->sock = -1;
        zclient_sync->redist_default = ZEBRA_ROUTE_LDP;
        zclient_sync->instance = instance;
index c8b775cb8e8bf96416a8703cf9aa52a62fbb198b..9dc56773584aae7fb8d59a8aa2b3d32e70cda066 100644 (file)
@@ -533,7 +533,7 @@ void
 ldp_zebra_init(struct thread_master *master)
 {
        /* Set default values. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_LDP, 0, &ldpd_privs);
 
        /* set callbacks */
index 55bb9e99ece130d0c3a8171e1fa6f5a9cafad658..40cac722ae8dba1a4a47db2cecea6661ff73680b 100644 (file)
@@ -188,9 +188,8 @@ DEFUN (agentx_enable,
                events = list_new();
                agentx_events_update();
                agentx_enabled = 1;
-               return CMD_SUCCESS;
        }
-       vty_out(vty, "SNMP AgentX already enabled\n");
+
        return CMD_SUCCESS;
 }
 
index 45a9f7be9e5ba392c23a9f61c56c35d7df728018..b879326d71b56deeb5dbc0fe6f9f041bdbec52b2 100644 (file)
@@ -58,8 +58,8 @@ int zclient_debug = 0;
 struct zclient_options zclient_options_default = {.receive_notify = false};
 
 /* Allocate zclient structure. */
-struct zclient *zclient_new_notify(struct thread_master *master,
-                                  struct zclient_options *opt)
+struct zclient *zclient_new(struct thread_master *master,
+                           struct zclient_options *opt)
 {
        struct zclient *zclient;
        zclient = XCALLOC(MTYPE_ZCLIENT, sizeof(struct zclient));
@@ -199,7 +199,7 @@ void zclient_reset(struct zclient *zclient)
  * @param zclient a pointer to zclient structure
  * @return socket fd just to make sure that connection established
  * @see zclient_init
- * @see zclient_new_notify
+ * @see zclient_new
  */
 int zclient_socket_connect(struct zclient *zclient)
 {
index 97ebb0811c26647acb64001d653ea6dd7b1d78d1..07fe512a3cc5ea7fe091e9659bf54b5a1065e31c 100644 (file)
@@ -422,23 +422,10 @@ struct zclient_options {
        bool receive_notify;
 };
 
-/* Prototypes of zebra client service functions. */
-extern struct zclient *zclient_new(struct thread_master *);
-
-/* clang-format off */
-#if CONFDATE > 20181101
-CPP_NOTICE("zclient_new_notify can take over or zclient_new now");
-#endif
-/* clang-format on */
-
 extern struct zclient_options zclient_options_default;
 
-extern struct zclient *zclient_new_notify(struct thread_master *m,
-                                         struct zclient_options *opt);
-
-#define zclient_new(A)                                                         \
-       zclient_new_notify((A), &zclient_options_default);                     \
-       CPP_WARN("Please transition to using zclient_new_notify");
+extern struct zclient *zclient_new(struct thread_master *m,
+                                  struct zclient_options *opt);
 
 extern void zclient_init(struct zclient *, int, unsigned short,
                         struct zebra_privs_t *privs);
index e7b187f3b607eeac0f747fcdca6a29c118923d85..dae00bbcea00d3e0005becebd9c54dfbfa5afef4 100644 (file)
@@ -344,7 +344,7 @@ void nhrp_zebra_init(void)
        zebra_rib[AFI_IP] = route_table_init();
        zebra_rib[AFI_IP6] = route_table_init();
 
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient->zebra_connected = nhrp_zebra_connected;
        zclient->interface_add = nhrp_interface_add;
        zclient->interface_delete = nhrp_interface_delete;
index bc52864313ed7c3072dc4b5a07767115ed7bacec..30f0e9e77421daaf10c682c71a0ab3d422a78989 100644 (file)
@@ -567,9 +567,10 @@ void ospf6_area_config_write(struct vty *vty)
 
 DEFUN (area_filter_list,
        area_filter_list_cmd,
-       "area A.B.C.D filter-list prefix WORD <in|out>",
+       "area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Filter networks between OSPF6 areas\n"
        "Filter prefixes between OSPF6 areas\n"
        "Name of an IPv6 prefix-list\n"
@@ -605,10 +606,11 @@ DEFUN (area_filter_list,
 
 DEFUN (no_area_filter_list,
        no_area_filter_list_cmd,
-       "no area A.B.C.D filter-list prefix WORD <in|out>",
+       "no area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Filter networks between OSPF6 areas\n"
        "Filter prefixes between OSPF6 areas\n"
        "Name of an IPv6 prefix-list\n"
@@ -662,9 +664,10 @@ void ospf6_area_plist_update(struct prefix_list *plist, int add)
 
 DEFUN (area_import_list,
        area_import_list_cmd,
-       "area A.B.C.D import-list NAME",
+       "area <A.B.C.D|(0-4294967295)> import-list NAME",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Set the filter for networks from other areas announced to the specified one\n"
        "Name of the acess-list\n")
 {
@@ -690,10 +693,11 @@ DEFUN (area_import_list,
 
 DEFUN (no_area_import_list,
        no_area_import_list_cmd,
-       "no area A.B.C.D import-list NAME",
+       "no area <A.B.C.D|(0-4294967295)> import-list NAME",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Unset the filter for networks announced to other areas\n"
        "Name of the access-list\n")
 {
@@ -715,9 +719,10 @@ DEFUN (no_area_import_list,
 
 DEFUN (area_export_list,
        area_export_list_cmd,
-       "area A.B.C.D export-list NAME",
+       "area <A.B.C.D|(0-4294967295)> export-list NAME",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Set the filter for networks announced to other areas\n"
        "Name of the acess-list\n")
 {
@@ -743,10 +748,11 @@ DEFUN (area_export_list,
 
 DEFUN (no_area_export_list,
        no_area_export_list_cmd,
-       "no area A.B.C.D export-list NAME",
+       "no area <A.B.C.D|(0-4294967295)> export-list NAME",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Unset the filter for networks announced to other areas\n"
        "Name of the access-list\n")
 {
index c968b35d904805ed4a12edb989cca63e86747ba4..5db9b529efe3cdbb73427c0679fa2c50110d2c39 100644 (file)
@@ -586,7 +586,7 @@ static void ospf6_zebra_connected(struct zclient *zclient)
 void ospf6_zebra_init(struct thread_master *master)
 {
        /* Allocate zebra structure. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0, &ospf6d_privs);
        zclient->zebra_connected = ospf6_zebra_connected;
        zclient->router_id_update = ospf6_router_id_update_zebra;
index ed19ae4f316d0b7241a0218b3f4e03159ea2a171..c7bde55cd9d12c10ebd0e87a8586ec5c916cb386 100644 (file)
@@ -1577,7 +1577,7 @@ static void ospf_zebra_connected(struct zclient *zclient)
 void ospf_zebra_init(struct thread_master *master, unsigned short instance)
 {
        /* Allocate zebra structure. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_OSPF, instance, &ospfd_privs);
        zclient->zebra_connected = ospf_zebra_connected;
        zclient->router_id_update = ospf_router_id_update_zebra;
index b7391a171a653215e09d8b23bb99485bd82a3ae4..9db3edacb9bf4ce43dbcc6e382c0403b7aa8f026 100644 (file)
@@ -391,7 +391,7 @@ void pbr_zebra_init(void)
 {
        struct zclient_options opt = { .receive_notify = true };
 
-       zclient = zclient_new_notify(master, &opt);
+       zclient = zclient_new(master, &opt);
 
        zclient_init(zclient, ZEBRA_ROUTE_PBR, 0, &pbr_privs);
        zclient->zebra_connected = zebra_connected;
index 23001031e350ece1b3db07b94a91c0caf6f9e8b7..3dfc36a0c2e8ae18d060741031786a267522f0b5 100644 (file)
@@ -746,7 +746,7 @@ static void pim_zebra_connected(struct zclient *zclient)
 void pim_zebra_init(void)
 {
        /* Socket for receiving updates from Zebra daemon */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
 
        zclient->zebra_connected = pim_zebra_connected;
        zclient->router_id_update = pim_router_id_update_zebra;
index 0e74866117fe1c73b8930e0e8964ee262a60cc52..6b45313081d9fa75d111bbeba764a16c423d2b25 100644 (file)
@@ -120,7 +120,7 @@ void zclient_lookup_free(void)
 
 void zclient_lookup_new(void)
 {
-       zlookup = zclient_new_notify(master, &zclient_options_default);
+       zlookup = zclient_new(master, &zclient_options_default);
        if (!zlookup) {
                flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_new() failure",
                         __PRETTY_FUNCTION__);
index 2a56cd7b1b15750263b019757f0afe42558025e8..20f543a2588981b91bf8fe5faa34a9da4b0202cf 100644 (file)
@@ -211,7 +211,7 @@ static void rip_zebra_connected(struct zclient *zclient)
 void rip_zclient_init(struct thread_master *master)
 {
        /* Set default value to the zebra client structure. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_RIP, 0, &ripd_privs);
        zclient->zebra_connected = rip_zebra_connected;
        zclient->interface_add = rip_interface_add;
index a8cc9ee128b4977288fb71bf13c597b4455bb9b9..f2b69c85a796ae54d59f841fbf63288d35be0395 100644 (file)
@@ -414,7 +414,7 @@ static void ripng_zebra_connected(struct zclient *zclient)
 void zebra_init(struct thread_master *master)
 {
        /* Allocate zebra structure. */
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
 
        zclient->zebra_connected = ripng_zebra_connected;
index 286f320874ca3a80727eec1770f0ad8593203348..12bab73c5e3c31b3fd4f26125d6af85a2f9059f5 100644 (file)
@@ -281,7 +281,7 @@ void sharp_zebra_init(void)
 {
        struct zclient_options opt = {.receive_notify = true};
 
-       zclient = zclient_new_notify(master, &opt);
+       zclient = zclient_new(master, &opt);
 
        zclient_init(zclient, ZEBRA_ROUTE_SHARP, 0, &sharp_privs);
        zclient->zebra_connected = zebra_connected;
index 4e168e142cc09ef1d5658b3c33b01b5124786eda..fd4201e5625218e01deb2224c40c959ef7ebca60 100644 (file)
@@ -465,7 +465,7 @@ void static_zebra_init(void)
 {
        struct zclient_options opt = { .receive_notify = true };
 
-       zclient = zclient_new_notify(master, &opt);
+       zclient = zclient_new(master, &opt);
 
        zclient_init(zclient, ZEBRA_ROUTE_STATIC, 0, &static_privs);
        zclient->zebra_capabilities = static_zebra_capabilities;
index cd30d4622ba7bcaeecd2db28622f033f20df9e8e..a6202786bedcf2658e6cca77dc86f011f63494db 100644 (file)
@@ -12,6 +12,7 @@
 /bgpd/test_peer_attr
 /isisd/test_fuzz_isis_tlv
 /isisd/test_fuzz_isis_tlv_tests.h
+/isisd/test_isis_lspdb
 /isisd/test_isis_vertex_queue
 /lib/cli/test_cli
 /lib/cli/test_cli_clippy.c
index f0797827ce65e8e9a620d79282330dc7cf3b335c..04fbda42ebde788e5e1416eaa78739333d8fc25a 100644 (file)
@@ -379,7 +379,7 @@ static int global_test_init(void)
 {
        qobj_init();
        master = thread_master_create(NULL);
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        bgp_master_init(master);
        vrf_init(NULL, NULL, NULL, NULL, NULL);
        bgp_option_set(BGP_OPT_NO_LISTEN);
diff --git a/tests/isisd/test_isis_lspdb.c b/tests/isisd/test_isis_lspdb.c
new file mode 100644 (file)
index 0000000..b9c6f2b
--- /dev/null
@@ -0,0 +1,87 @@
+#include <zebra.h>
+
+#include "isisd/isis_lsp.c"
+
+struct thread_master *master;
+
+int isis_sock_init(struct isis_circuit *circuit);
+int isis_sock_init(struct isis_circuit *circuit)
+{
+       return 0;
+}
+
+struct zebra_privs_t isisd_privs;
+
+static void test_lsp_build_list_nonzero_ht(void)
+{
+       uint8_t lsp_id1[8]    = {
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
+       };
+       uint8_t lsp_id_end[8] = {
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5f, 0x00
+       };
+       uint8_t lsp_id2[8]    = {
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
+       };
+
+       struct isis_area *area = calloc(sizeof(*area), 1);
+
+       area->lsp_mtu = 1500;
+
+       dict_t *lspdb = lsp_db_init();
+
+       struct isis_lsp *lsp1 = lsp_new(area, lsp_id1, 6000, 0, 0, 0, NULL,
+                                       ISIS_LEVEL2);
+
+       lsp_insert(lsp1, lspdb);
+
+       struct isis_lsp *lsp2 = lsp_new(area, lsp_id2, 6000, 0, 0, 0, NULL,
+                                       ISIS_LEVEL2);
+
+       lsp_insert(lsp2, lspdb);
+
+       struct list *list = list_new();
+
+       lsp_build_list_nonzero_ht(lsp_id1, lsp_id_end, list, lspdb);
+       assert(list->count == 1);
+       assert(listgetdata(listhead(list)) == lsp1);
+       list_delete_all_node(list);
+
+       lsp_id_end[5] = 0x03;
+       lsp_id_end[6] = 0x00;
+
+       lsp_build_list_nonzero_ht(lsp_id1, lsp_id_end, list, lspdb);
+       assert(list->count == 2);
+       assert(listgetdata(listhead(list)) == lsp1);
+       assert(listgetdata(listtail(list)) == lsp2);
+       list_delete_all_node(list);
+
+       memcpy(lsp_id1, lsp_id2, sizeof(lsp_id1));
+
+       lsp_build_list_nonzero_ht(lsp_id1, lsp_id_end, list, lspdb);
+       assert(list->count == 1);
+       assert(listgetdata(listhead(list)) == lsp2);
+       list_delete_all_node(list);
+
+       lsp_id1[5] = 0x03;
+       lsp_id_end[5] = 0x04;
+
+       lsp_build_list_nonzero_ht(lsp_id1, lsp_id_end, list, lspdb);
+       assert(list->count == 0);
+       list_delete_all_node(list);
+
+       lsp_id1[5] = 0x00;
+
+       lsp_build_list_nonzero_ht(lsp_id1, lsp_id_end, list, lspdb);
+       assert(list->count == 2);
+       assert(listgetdata(listhead(list)) == lsp1);
+       assert(listgetdata(listtail(list)) == lsp2);
+       list_delete_all_node(list);
+}
+
+int main(int argc, char **argv)
+{
+       isis = calloc(sizeof(*isis), 1);
+       test_lsp_build_list_nonzero_ht();
+       return 0;
+}
diff --git a/tests/isisd/test_isis_lspdb.py b/tests/isisd/test_isis_lspdb.py
new file mode 100644 (file)
index 0000000..cd0b534
--- /dev/null
@@ -0,0 +1,6 @@
+import frrtest
+
+class TestIsisLSPDB(frrtest.TestMultiOut):
+    program = './test_isis_lspdb'
+
+TestIsisLSPDB.exit_cleanly()
index b7dfa9d5f8a3a1c53fa0390006e0c1b2c5222326..6b52c90bc01325b3e0a7f03f16ce234a88a4109d 100644 (file)
@@ -24,6 +24,7 @@ TESTS_ISISD =
 else
 TESTS_ISISD = \
        tests/isisd/test_fuzz_isis_tlv \
+       tests/isisd/test_isis_lspdb \
        tests/isisd/test_isis_vertex_queue \
        # end
 endif
@@ -156,6 +157,10 @@ tests_isisd_test_fuzz_isis_tlv_CPPFLAGS = $(TESTS_CPPFLAGS) -I$(top_builddir)/te
 tests_isisd_test_fuzz_isis_tlv_LDADD = $(ISISD_TEST_LDADD)
 tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv.c
 nodist_tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv_tests.h
+tests_isisd_test_isis_lspdb_CFLAGS = $(TESTS_CFLAGS)
+tests_isisd_test_isis_lspdb_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_isisd_test_isis_lspdb_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_isis_lspdb_SOURCES = tests/isisd/test_isis_lspdb.c
 tests_isisd_test_isis_vertex_queue_CFLAGS = $(TESTS_CFLAGS)
 tests_isisd_test_isis_vertex_queue_CPPFLAGS = $(TESTS_CPPFLAGS)
 tests_isisd_test_isis_vertex_queue_LDADD = $(ISISD_TEST_LDADD)
@@ -271,6 +276,7 @@ EXTRA_DIST += \
        tests/helpers/python/frrtest.py \
        tests/isisd/test_fuzz_isis_tlv.py \
        tests/isisd/test_fuzz_isis_tlv_tests.h.gz \
+       tests/isisd/test_isis_lspdb.py \
        tests/isisd/test_isis_vertex_queue.py \
        tests/lib/cli/test_commands.in \
        tests/lib/cli/test_commands.py \
index 9d1c05436c2a42b26ea03c58761cb0ea2bc5a1bd..e71e680fad5983c49eaf9eaf7caa7b68f9ee0216 100644 (file)
@@ -119,7 +119,7 @@ void init_zclient(struct thread_master *master, char *lm_zserv_path)
 {
        frr_zclient_addr(&zclient_addr, &zclient_addr_len, lm_zserv_path);
 
-       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default);
        /* zclient_init(zclient, ZEBRA_LABEL_MANAGER, 0); */
        zclient->sock = -1;
        zclient->redist_default = ZEBRA_ROUTE_LDP;
index bd0e370d1eab152f49384c745aac64687f5afe38..94221301eb92226097edcfea4a8cd5697fe855d3 100644 (file)
@@ -24,7 +24,8 @@ fabricd_options="  --daemon -A 127.0.0.1"
 
 # The list of daemons to watch is automatically generated by the init script.
 watchfrr_enable=yes
-watchfrr_options=(-d -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB)
+
+watchfrr_options=(-d -r /usr/lib/frr/frrbBrestartbB%s -s /usr/lib/frr/frrbBstartbB%s -k /usr/lib/frr/frrbBstopbB%s -b bB)
 
 # If valgrind_enable is 'yes' the frr daemons will be started via valgrind.
 # The use case for doing so is tracking down memory leaks, etc in frr.
index ee8dc883dc3f97fe5c761e20c0c2f4eaa4689bba..ec383bc5a0d6d72728b5f0edafffaf8c746cd672 100755 (executable)
@@ -127,6 +127,7 @@ start()
                        echo -n " $1"
                fi
 
+
                ${SSD} \
                        --start \
                        --pidfile=`pidfile $1` \
@@ -148,7 +149,6 @@ start()
                        -- \
                        `eval echo "$""$1""_options"` -n "$2"
        else
-               echo -n " $1"
                if ! check_daemon $1; then
                        echo -n " (binary does not exist)"
                        return;
@@ -210,7 +210,6 @@ stop()
                #       Now we have to wait until $DAEMON has _really_ stopped.
                #
                if test -n "$PID" && kill -0 $PID 2>/dev/null; then
-                       echo -n " (waiting) ."
                        cnt=0
                        while kill -0 $PID 2>/dev/null; do
                                cnt=`expr $cnt + 1`
@@ -220,10 +219,8 @@ stop()
                                        break
                                fi
                                sleep 2
-                               echo -n "."
                        done
                fi
-               echo -n " $inst"
                rm -f `pidfile $inst`
                rm -f `vtyfile $inst`
 
@@ -305,7 +302,6 @@ start_watchfrr()
 
        # Start if at least one daemon is activated.
        if [ $found_one -eq 1 ]; then
-               echo -n "Starting Frr monitor daemon:"
                start watchfrr
                echo "."
        fi
@@ -408,8 +404,6 @@ start_prio()
        wanted_prio=$1
        daemon_list=${daemon:-$DAEMONS}
 
-       echo -n "Starting Frr daemons (prio:$wanted_prio):"
-
        for prio_i in `seq 1 $wanted_prio`; do
                for daemon_name in $daemon_list; do
                        eval daemon_prio=\$${daemon_name}
@@ -447,7 +441,6 @@ start_prio()
                                        eval "file_list_suffix="$V_PATH"/"$daemon_name-*""
                                        for pidfile in $file_list_suffix.pid; do
                                                ${SSD} --stop --quiet --oknodo --pidfile "$pidfile"
-                                               echo -n "."
                                                rm -rf "$pidfile"
                                        done
                                        for vtyfile in $file_list_suffix.vty; do
@@ -459,7 +452,6 @@ start_prio()
                        fi
                done
        done
-       echo "."
 }
 
 check_status()
index 8e459160c6ea1f3276f17f5f4576832a1bf54b72..f4bd193569b89444173a5f14e1248324f0d7ee7a 100644 (file)
@@ -243,7 +243,8 @@ static enum zebra_link_type netlink_to_zebra_link_type(unsigned int hwt)
        }
 }
 
-static void netlink_determine_zebra_iftype(char *kind, zebra_iftype_t *zif_type)
+static void netlink_determine_zebra_iftype(const char *kind,
+                                          zebra_iftype_t *zif_type)
 {
        *zif_type = ZEBRA_IF_OTHER;
 
@@ -262,6 +263,10 @@ static void netlink_determine_zebra_iftype(char *kind, zebra_iftype_t *zif_type)
                *zif_type = ZEBRA_IF_MACVLAN;
        else if (strcmp(kind, "veth") == 0)
                *zif_type = ZEBRA_IF_VETH;
+       else if (strcmp(kind, "bond") == 0)
+               *zif_type = ZEBRA_IF_BOND;
+       else if (strcmp(kind, "bond_slave") == 0)
+               *zif_type = ZEBRA_IF_BOND_SLAVE;
 }
 
 #define parse_rtattr_nested(tb, max, rta)                                      \
@@ -585,6 +590,7 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        zebra_slave_iftype_t zif_slave_type = ZEBRA_IF_SLAVE_NONE;
        ifindex_t bridge_ifindex = IFINDEX_INTERNAL;
        ifindex_t link_ifindex = IFINDEX_INTERNAL;
+       ifindex_t bond_ifindex = IFINDEX_INTERNAL;
        struct zebra_if *zif;
 
        zns = zebra_ns_lookup(ns_id);
@@ -635,7 +641,10 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                if (linkinfo[IFLA_INFO_SLAVE_KIND])
                        slave_kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]);
 
-               netlink_determine_zebra_iftype(kind, &zif_type);
+               if ((slave_kind != NULL) && strcmp(slave_kind, "bond") == 0)
+                       netlink_determine_zebra_iftype("bond_slave", &zif_type);
+               else
+                       netlink_determine_zebra_iftype(kind, &zif_type);
        }
 
        /* If VRF, create the VRF structure itself. */
@@ -653,6 +662,9 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        zif_slave_type = ZEBRA_IF_SLAVE_BRIDGE;
                        bridge_ifindex =
                                *(ifindex_t *)RTA_DATA(tb[IFLA_MASTER]);
+               } else if (slave_kind && (strcmp(slave_kind, "bond") == 0)) {
+                       zif_slave_type = ZEBRA_IF_SLAVE_BOND;
+                       bond_ifindex = *(ifindex_t *)RTA_DATA(tb[IFLA_MASTER]);
                } else
                        zif_slave_type = ZEBRA_IF_SLAVE_OTHER;
        }
@@ -700,6 +712,8 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        netlink_interface_update_l2info(ifp, linkinfo[IFLA_INFO_DATA], 1);
        if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp))
                zebra_l2if_update_bridge_slave(ifp, bridge_ifindex);
+       else if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
+               zebra_l2if_update_bond_slave(ifp, bond_ifindex);
 
        return 0;
 }
@@ -1081,6 +1095,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        zebra_iftype_t zif_type = ZEBRA_IF_OTHER;
        zebra_slave_iftype_t zif_slave_type = ZEBRA_IF_SLAVE_NONE;
        ifindex_t bridge_ifindex = IFINDEX_INTERNAL;
+       ifindex_t bond_ifindex = IFINDEX_INTERNAL;
        ifindex_t link_ifindex = IFINDEX_INTERNAL;
 
 
@@ -1180,6 +1195,11 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                                zif_slave_type = ZEBRA_IF_SLAVE_BRIDGE;
                                bridge_ifindex =
                                        *(ifindex_t *)RTA_DATA(tb[IFLA_MASTER]);
+                       } else if (slave_kind
+                                  && (strcmp(slave_kind, "bond") == 0)) {
+                               zif_slave_type = ZEBRA_IF_SLAVE_BOND;
+                               bond_ifindex =
+                                       *(ifindex_t *)RTA_DATA(tb[IFLA_MASTER]);
                        } else
                                zif_slave_type = ZEBRA_IF_SLAVE_OTHER;
                }
@@ -1239,6 +1259,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp))
                                zebra_l2if_update_bridge_slave(ifp,
                                                               bridge_ifindex);
+                       else if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
+                               zebra_l2if_update_bond_slave(ifp, bond_ifindex);
                } else if (ifp->vrf_id != vrf_id) {
                        /* VRF change for an interface. */
                        if (IS_ZEBRA_DEBUG_KERNEL)
@@ -1250,7 +1272,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
                        if_handle_vrf_change(ifp, vrf_id);
                } else {
-                       int was_bridge_slave;
+                       bool was_bridge_slave, was_bond_slave;
 
                        /* Interface update. */
                        if (IS_ZEBRA_DEBUG_KERNEL)
@@ -1273,6 +1295,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        /* Update interface type - NOTE: Only slave_type can
                         * change. */
                        was_bridge_slave = IS_ZEBRA_IF_BRIDGE_SLAVE(ifp);
+                       was_bond_slave = IS_ZEBRA_IF_BOND_SLAVE(ifp);
                        zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
 
                        netlink_interface_update_hw_addr(tb, ifp);
@@ -1312,6 +1335,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) || was_bridge_slave)
                                zebra_l2if_update_bridge_slave(ifp,
                                                               bridge_ifindex);
+                       else if (IS_ZEBRA_IF_BOND_SLAVE(ifp) || was_bond_slave)
+                               zebra_l2if_update_bond_slave(ifp, bond_ifindex);
                }
        } else {
                /* Delete interface notification from kernel */
index afb08f7012f00b56f9ba6d2b66e970bc6569db84..76e0a09c170dcff494cc15b94a2f9fb4f412fdb3 100644 (file)
@@ -1150,6 +1150,15 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type)
                return "VETH";
                break;
 
+       case ZEBRA_IF_BOND:
+               return "bond";
+
+       case ZEBRA_IF_BOND_SLAVE:
+               return "bond_slave";
+
+       case ZEBRA_IF_MACVLAN:
+               return "macvlan";
+
        default:
                return "Unknown";
                break;
@@ -1279,6 +1288,15 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
                                br_slave->bridge_ifindex);
        }
 
+       if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) {
+               struct zebra_l2info_bondslave *bond_slave;
+
+               bond_slave = &zebra_if->bondslave_info;
+               if (bond_slave->bond_ifindex != IFINDEX_INTERNAL)
+                       vty_out(vty, "  Master (bond) ifindex %u\n",
+                               bond_slave->bond_ifindex);
+       }
+
        if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
                vty_out(vty, "  Link ifindex %u", zebra_if->link_ifindex);
                if (zebra_if->link)
index e4c05e8dc47136847ecbf9dbcf8d1d1284d63429..01dd6977729dc9f8c78d456ca68556b31e0b5797 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Interface function header.
  * Copyright (C) 1999 Kunihiro Ishiguro
  *
@@ -192,6 +193,8 @@ typedef enum {
        ZEBRA_IF_VLAN,      /* VLAN sub-interface */
        ZEBRA_IF_MACVLAN,   /* MAC VLAN interface*/
        ZEBRA_IF_VETH,      /* VETH interface*/
+       ZEBRA_IF_BOND,      /* Bond */
+       ZEBRA_IF_BOND_SLAVE,        /* Bond */
 } zebra_iftype_t;
 
 /* Zebra "slave" interface type */
@@ -199,6 +202,7 @@ typedef enum {
        ZEBRA_IF_SLAVE_NONE,   /* Not a slave */
        ZEBRA_IF_SLAVE_VRF,    /* Member of a VRF */
        ZEBRA_IF_SLAVE_BRIDGE, /* Member of a bridge */
+       ZEBRA_IF_SLAVE_BOND,   /* Bond member */
        ZEBRA_IF_SLAVE_OTHER,  /* Something else - e.g., bond slave */
 } zebra_slave_iftype_t;
 
@@ -268,6 +272,8 @@ struct zebra_if {
         */
        struct zebra_l2info_brslave brslave_info;
 
+       struct zebra_l2info_bondslave bondslave_info;
+
        /* Link fields - for sub-interfaces. */
        ifindex_t link_ifindex;
        struct interface *link;
@@ -324,6 +330,10 @@ static inline void zebra_if_set_ziftype(struct interface *ifp,
 #define IS_ZEBRA_IF_VRF_SLAVE(ifp)                                             \
        (((struct zebra_if *)(ifp->info))->zif_slave_type == ZEBRA_IF_SLAVE_VRF)
 
+#define IS_ZEBRA_IF_BOND_SLAVE(ifp)                                    \
+       (((struct zebra_if *)(ifp->info))->zif_slave_type                      \
+        == ZEBRA_IF_SLAVE_BOND)
+
 extern void zebra_if_init(void);
 
 extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *, uint32_t);
index 8afb1a0b79f452bfb2a688baa9fa47eed60a709d..bfad8ea643f7aac5cec4e4e43211aa0639644387 100644 (file)
@@ -318,7 +318,7 @@ static void lm_zclient_init(char *lm_zserv_path)
                                 lm_zserv_path);
 
        /* Set default values. */
-       zclient = zclient_new_notify(zebrad.master, &zclient_options_default);
+       zclient = zclient_new(zebrad.master, &zclient_options_default);
        zclient->privs = &zserv_privs;
        zclient->sock = -1;
        zclient->t_connect = NULL;
index 529fc48edfcd21410f02d544f5b1bd1b1d19beaf..f4b2fe4794da14d73d453b445d86820d2cde6c3c 100644 (file)
@@ -99,6 +99,23 @@ void zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave *br_slave)
        br_slave->br_if = NULL;
 }
 
+void zebra_l2_map_slave_to_bond(struct zebra_l2info_bondslave *bond_slave)
+{
+       struct interface *bond_if;
+
+       /* TODO: Handle change of master */
+       bond_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
+                                           bond_slave->bond_ifindex);
+       if (bond_if)
+               bond_slave->bond_if = bond_if;
+}
+
+void zebra_l2_unmap_slave_from_bond(struct zebra_l2info_bondslave *bond_slave)
+{
+       if (bond_slave != NULL)
+               bond_slave->bond_if = NULL;
+}
+
 /*
  * Handle Bridge interface add or update. Update relevant info,
  * map slaves (if any) to the bridge.
@@ -238,3 +255,24 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
                zebra_l2_unmap_slave_from_bridge(&zif->brslave_info);
        }
 }
+
+void zebra_l2if_update_bond_slave(struct interface *ifp, ifindex_t bond_ifindex)
+{
+       struct zebra_if *zif;
+       ifindex_t old_bond_ifindex;
+
+       zif = ifp->info;
+       assert(zif);
+
+       old_bond_ifindex = zif->bondslave_info.bond_ifindex;
+       if (old_bond_ifindex == bond_ifindex)
+               return;
+
+       zif->bondslave_info.bond_ifindex = bond_ifindex;
+
+       /* Set up or remove link with master */
+       if (bond_ifindex != IFINDEX_INTERNAL)
+               zebra_l2_map_slave_to_bond(&zif->bondslave_info);
+       else if (old_bond_ifindex != IFINDEX_INTERNAL)
+               zebra_l2_unmap_slave_from_bond(&zif->bondslave_info);
+}
index db6cb0e53aa7a10fb0293e7085b51f30a846efe4..68c9d4a7a1a72bbf072da5a105aabd4a04eb2179 100644 (file)
@@ -52,6 +52,11 @@ struct zebra_l2info_vxlan {
        vlanid_t access_vlan;   /* Access VLAN - for VLAN-aware bridge. */
 };
 
+struct zebra_l2info_bondslave {
+       ifindex_t bond_ifindex;    /* Bridge Master */
+       struct interface *bond_if; /* Pointer to master */
+};
+
 union zebra_l2if_info {
        struct zebra_l2info_bridge br;
        struct zebra_l2info_vlan vl;
@@ -70,6 +75,10 @@ union zebra_l2if_info {
 extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave);
 extern void
 zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave *br_slave);
+extern void
+zebra_l2_map_slave_to_bond(struct zebra_l2info_bondslave *bond_slave);
+extern void
+zebra_l2_unmap_slave_from_bond(struct zebra_l2info_bondslave *bond_slave);
 extern void zebra_l2_bridge_add_update(struct interface *ifp,
                                       struct zebra_l2info_bridge *bridge_info,
                                       int add);
@@ -85,4 +94,6 @@ extern void zebra_l2_vxlanif_del(struct interface *ifp);
 extern void zebra_l2if_update_bridge_slave(struct interface *ifp,
                                           ifindex_t bridge_ifindex);
 
+extern void zebra_l2if_update_bond_slave(struct interface *ifp,
+                                        ifindex_t bond_ifindex);
 #endif /* _ZEBRA_L2_H */
index d55467c727f30f5a9704d28f9ede8e5d43bf7e02..828539252732166570af5970fd31135c58a703db 100644 (file)
@@ -358,8 +358,6 @@ static void nexthop_set_resolved(afi_t afi, const struct nexthop *newhop,
                if (newhop->ifindex) {
                        resolved_hop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
                        resolved_hop->ifindex = newhop->ifindex;
-                       if (newhop->flags & NEXTHOP_FLAG_ONLINK)
-                               resolved_hop->flags |= NEXTHOP_FLAG_ONLINK;
                }
                break;
        case NEXTHOP_TYPE_IPV6:
@@ -398,6 +396,9 @@ static void nexthop_set_resolved(afi_t afi, const struct nexthop *newhop,
                break;
        }
 
+       if (newhop->flags & NEXTHOP_FLAG_ONLINK)
+               resolved_hop->flags |= NEXTHOP_FLAG_ONLINK;
+
        /* Copy labels of the resolved route */
        if (newhop->nh_label)
                nexthop_add_labels(resolved_hop, newhop->nh_label_type,
index bacef498362b4c23ed40b50813f21a7d90ca24e4..c9918a7887e3b66abc1cb9520cd6fbcfa3c34eb5 100644 (file)
@@ -1116,15 +1116,15 @@ static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
 
 /* Match function should return 1 if match is success else return
    zero. */
-static route_map_result_t route_match_ip_address(void *rule,
-                                                const struct prefix *prefix,
-                                                route_map_object_t type,
-                                                void *object)
+static route_map_result_t route_match_address(afi_t afi, void *rule,
+                                             const struct prefix *prefix,
+                                             route_map_object_t type,
+                                             void *object)
 {
        struct access_list *alist;
 
        if (type == RMAP_ZEBRA) {
-               alist = access_list_lookup(AFI_IP, (char *)rule);
+               alist = access_list_lookup(afi, (char *)rule);
                if (alist == NULL)
                        return RMAP_NOMATCH;
 
@@ -1135,23 +1135,45 @@ static route_map_result_t route_match_ip_address(void *rule,
        return RMAP_NOMATCH;
 }
 
+static route_map_result_t route_match_ip_address(void *rule,
+                                                const struct prefix *prefix,
+                                                route_map_object_t type,
+                                                void *object)
+{
+       return route_match_address(AFI_IP, rule, prefix, type, object);
+}
+
+static route_map_result_t route_match_ipv6_address(void *rule,
+                                                  const struct prefix *prefix,
+                                                  route_map_object_t type,
+                                                  void *object)
+
+{
+       return route_match_address(AFI_IP6, rule, prefix, type, object);
+}
+
 /* Route map `ip address' match statement.  `arg' should be
    access-list name. */
-static void *route_match_ip_address_compile(const char *arg)
+static void *route_match_address_compile(const char *arg)
 {
        return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
 /* Free route map's compiled `ip address' value. */
-static void route_match_ip_address_free(void *rule)
+static void route_match_address_free(void *rule)
 {
        XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Route map commands for ip address matching. */
 static struct route_map_rule_cmd route_match_ip_address_cmd = {
-       "ip address", route_match_ip_address, route_match_ip_address_compile,
-       route_match_ip_address_free};
+       "ip address", route_match_ip_address, route_match_address_compile,
+       route_match_address_free};
+
+/* Route map commands for ipv6 address matching. */
+static struct route_map_rule_cmd route_match_ipv6_address_cmd = {
+       "ipv6 address", route_match_ipv6_address, route_match_address_compile,
+       route_match_address_free};
 
 /* `match ip address prefix-list PREFIX_LIST' */
 
@@ -1869,6 +1891,7 @@ void zebra_route_map_init()
        route_map_install_match(&route_match_ip_next_hop_cmd);
        route_map_install_match(&route_match_ip_next_hop_prefix_list_cmd);
        route_map_install_match(&route_match_ip_address_cmd);
+       route_map_install_match(&route_match_ipv6_address_cmd);
        route_map_install_match(&route_match_ip_address_prefix_list_cmd);
        route_map_install_match(&route_match_ipv6_address_prefix_list_cmd);
        route_map_install_match(&route_match_ip_address_prefix_len_cmd);