]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge remote-tracking branch 'origin/stable/3.0'
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 15 May 2017 01:19:33 +0000 (21:19 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 15 May 2017 01:19:33 +0000 (21:19 -0400)
1  2 
bgpd/bgp_route.c
vtysh/vtysh.c

diff --combined bgpd/bgp_route.c
index 24a68778dcb48ed7b6020f928a15ba48f6d0b63a,de51de7a66f45b41072b672e051679d100f30517..834b9e073e24a7226983eb1fb0f6d4e39bfe826b
@@@ -35,7 -35,6 +35,7 @@@ Software Foundation, Inc., 59 Temple Pl
  #include "thread.h"
  #include "workqueue.h"
  #include "queue.h"
 +#include "mpls.h"
  #include "memory.h"
  #include "lib/json.h"
  
@@@ -63,7 -62,6 +63,7 @@@
  #include "bgpd/bgp_mpath.h"
  #include "bgpd/bgp_nht.h"
  #include "bgpd/bgp_updgrp.h"
 +#include "bgpd/bgp_label.h"
  
  #if ENABLE_BGP_VNC
  #include "bgpd/rfapi/rfapi_backend.h"
@@@ -298,11 -296,6 +298,11 @@@ bgp_pcount_adjust (struct bgp_node *rn
      }
  }
  
 +static int
 +bgp_label_index_differs (struct bgp_info *ri1, struct bgp_info *ri2)
 +{
 +  return (!(ri1->attr->extra->label_index == ri2->attr->extra->label_index));
 +}
  
  /* Set/unset bgp_info flags, adjusting any other state as needed.
   * This is here primarily to keep prefix-count in check.
@@@ -1194,8 -1187,7 +1194,8 @@@ subgroup_announce_reset_nhop (u_char fa
  }
  
  int
 -subgroup_announce_check (struct bgp_info *ri, struct update_subgroup *subgrp,
 +subgroup_announce_check (struct bgp_node *rn, struct bgp_info *ri,
 +                         struct update_subgroup *subgrp,
                         struct prefix *p, struct attr *attr)
  {
    struct bgp_filter *filter;
        return 0;
        }
  
 +  /* If it's labeled safi, make sure the route has a valid label. */
 +  if (bgp_labeled_safi(safi))
 +    {
 +      u_char *tag = bgp_adv_label(rn, ri, peer, afi, safi);
 +      if (!bgp_is_valid_label(tag))
 +        {
 +          if (bgp_debug_update(NULL, p, subgrp->update_group, 0))
 +           zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s/%d is filtered - no label (%p)",
 +                  subgrp->update_group->id, subgrp->id,
 +                 inet_ntop(p->family, &p->u.prefix, buf, SU_ADDRSTRLEN),
 +                 p->prefixlen, tag);
 +          return 0;
 +        }
 +    }
 +
    /* Do not send back route to sender. */
    if (onlypeer && from == onlypeer)
      {
  
  #define NEXTHOP_IS_V6 (\
      (safi != SAFI_ENCAP && safi != SAFI_MPLS_VPN &&\
 -     (p->family == AF_INET6 || peer_cap_enhe(peer))) || \
 +     (p->family == AF_INET6 || peer_cap_enhe(peer, AFI_IP6, safi))) || \
      ((safi == SAFI_ENCAP || safi == SAFI_MPLS_VPN) &&\
       attr->extra->mp_nexthop_len >= IPV6_MAX_BYTELEN))
  
            if (!reflect ||
                CHECK_FLAG (peer->af_flags[afi][safi],
                            PEER_FLAG_FORCE_NEXTHOP_SELF))
 -            subgroup_announce_reset_nhop ((peer_cap_enhe(peer) ?
 +            subgroup_announce_reset_nhop ((peer_cap_enhe(peer, afi, safi) ?
                            AF_INET6 : p->family), attr);
          }
        else if (peer->sort == BGP_PEER_EBGP)
                  break;
              }
            if (!paf)
 -            subgroup_announce_reset_nhop ((peer_cap_enhe(peer) ? AF_INET6 : p->family), attr);
 +            subgroup_announce_reset_nhop ((peer_cap_enhe(peer, afi, safi) ? AF_INET6 : p->family), attr);
          }
        /* If IPv6/MP and nexthop does not have any override and happens to
         * be a link-local address, reset it so that we don't pass along the
         * source's link-local IPv6 address to recipients who may not be on
         * the same interface.
         */
 -      if (p->family == AF_INET6 || peer_cap_enhe(peer))
 +      if (p->family == AF_INET6 || peer_cap_enhe(peer, afi, safi))
          {
            if (IN6_IS_ADDR_LINKLOCAL (&attr->extra->mp_nexthop_global))
              subgroup_announce_reset_nhop (AF_INET6, attr);
@@@ -1827,7 -1804,7 +1827,7 @@@ subgroup_process_announce_selected (str
    /* Announcement to the subgroup.  If the route is filtered withdraw it. */
    if (selected)
      {
 -      if (subgroup_announce_check(selected, subgrp, p, &attr))
 +      if (subgroup_announce_check(rn, selected, subgrp, p, &attr))
          bgp_adj_out_set_subgroup(rn, subgrp, &attr, selected);
        else
          bgp_adj_out_unset_subgroup(rn, subgrp, 1, selected->addpath_tx_id);
@@@ -1937,40 -1914,7 +1937,40 @@@ bgp_process_main (struct work_queue *wq
    old_select = old_and_new.old;
    new_select = old_and_new.new;
  
 -  /* Nothing to do. */
 +  /* Do we need to allocate or free labels?
 +   * Right now, since we only deal with per-prefix labels, it is not necessary
 +   * to do this upon changes to best path except of the label index changes.
 +   */
 +  bgp_table_lock (bgp_node_table (rn));
 +  if (bgp_labeled_safi (safi))
 +    {
 +      if (new_select)
 +        {
 +          if (!old_select ||
 +              bgp_label_index_differs (new_select, old_select) ||
 +              new_select->sub_type != old_select->sub_type)
 +            {
 +              if (new_select->sub_type == BGP_ROUTE_STATIC &&
 +                  new_select->attr->flag & ATTR_FLAG_BIT (BGP_ATTR_PREFIX_SID) &&
 +                  new_select->attr->extra->label_index != BGP_INVALID_LABEL_INDEX)
 +                {
 +                  if (CHECK_FLAG (rn->flags, BGP_NODE_REGISTERED_FOR_LABEL))
 +                    bgp_unregister_for_label (rn);
 +                  label_ntop (MPLS_IMP_NULL_LABEL, 1, rn->local_label);
 +                  bgp_set_valid_label(rn->local_label);
 +                }
 +              else
 +                bgp_register_for_label (rn, new_select);
 +            }
 +        }
 +      else if (CHECK_FLAG (rn->flags, BGP_NODE_REGISTERED_FOR_LABEL))
 +        bgp_unregister_for_label (rn);
 +    }
 +
 +  /* If best route remains the same and this is not due to user-initiated
 +   * clear, see exactly what needs to be done.
 +   */
 +
    if (old_select && old_select == new_select &&
        !CHECK_FLAG(rn->flags, BGP_NODE_USER_CLEAR) &&
        !CHECK_FLAG(old_select->flags, BGP_INFO_ATTR_CHANGED) &&
                vnc_import_bgp_add_route(bgp, p, old_select);
                vnc_import_bgp_exterior_add_route(bgp, p, old_select);
  #endif
 -        bgp_zebra_announce (p, old_select, bgp, afi, safi);
 +          if (bgp_fibupd_safi(safi) &&
 +              !bgp->name &&
 +              !bgp_option_check (BGP_OPT_NO_FIB) &&
 +              new_select->type == ZEBRA_ROUTE_BGP &&
 +              new_select->sub_type == BGP_ROUTE_NORMAL)
 +            bgp_zebra_announce (rn, p, old_select, bgp, afi, safi);
          }
        UNSET_FLAG (old_select->flags, BGP_INFO_MULTIPATH_CHG);
        bgp_zebra_clear_route_change_flags (rn);
 +
 +      /* If there is a change of interest to peers, reannounce the route. */
 +      if (CHECK_FLAG (old_select->flags, BGP_INFO_ATTR_CHANGED) ||
 +          CHECK_FLAG (rn->flags, BGP_NODE_LABEL_CHANGED))
 +        {
 +          group_announce_route(bgp, afi, safi, rn, new_select);
 +
 +          UNSET_FLAG (old_select->flags, BGP_INFO_ATTR_CHANGED);
 +          UNSET_FLAG (rn->flags, BGP_NODE_LABEL_CHANGED);
 +         }
 +
        UNSET_FLAG (rn->flags, BGP_NODE_PROCESS_SCHEDULED);
        return WQ_SUCCESS;
      }
        if (!bgp->t_rmap_def_originate_eval)
          {
            bgp_lock (bgp);
 -          THREAD_TIMER_ON(bm->master, bgp->t_rmap_def_originate_eval,
 -                          update_group_refresh_default_originate_route_map,
 -                          bgp, RMAP_DEFAULT_ORIGINATE_EVAL_TIMER);
 +          thread_add_timer(bm->master,
 +                           update_group_refresh_default_originate_route_map,
 +                           bgp, RMAP_DEFAULT_ORIGINATE_EVAL_TIMER,
 +                           &bgp->t_rmap_def_originate_eval);
          }
      }
  
    group_announce_route(bgp, afi, safi, rn, new_select);
  
    /* FIB update. */
 -  if ((safi == SAFI_UNICAST || safi == SAFI_MULTICAST) &&
 +  if (bgp_fibupd_safi(safi) &&
        (bgp->inst_type != BGP_INSTANCE_TYPE_VIEW) &&
        !bgp_option_check (BGP_OPT_NO_FIB))
      {
          && new_select->type == ZEBRA_ROUTE_BGP 
          && (new_select->sub_type == BGP_ROUTE_NORMAL ||
                new_select->sub_type == BGP_ROUTE_AGGREGATE))
 -      bgp_zebra_announce (p, new_select, bgp, afi, safi);
 +      bgp_zebra_announce (rn, p, new_select, bgp, afi, safi);
        else
        {
          /* Withdraw the route from the kernel. */
@@@ -2479,7 -2406,6 +2479,7 @@@ bgp_update (struct peer *peer, struct p
    struct bgp_info *new;
    const char *reason;
    char pfx_buf[BGP_PRD_PATH_STRLEN];
 +  char label_buf[20];
    int connected = 0;
    int do_loop_check = 1;
  #if ENABLE_BGP_VNC
  
    bgp = peer->bgp;
    rn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, prd);
 +  label_buf[0] = '\0';
 +  if (bgp_labeled_safi(safi))
 +    sprintf (label_buf, "label %u", label_pton(tag));
    
    /* When peer's soft reconfiguration enabled.  Record input packet in
       Adj-RIBs-In.  */
        /* Same attribute comes in. */
        if (!CHECK_FLAG (ri->flags, BGP_INFO_REMOVED) 
            && attrhash_cmp (ri->attr, attr_new)
 +          && (!bgp_labeled_safi(safi) ||
 +              memcmp ((bgp_info_extra_get (ri))->tag, tag, 3) == 0)
            && (overlay_index_equal(afi, ri, evpn==NULL?NULL:&evpn->eth_s_id,
                                    evpn==NULL?NULL:&evpn->gw_ip)))
        {
              && CHECK_FLAG (ri->flags, BGP_INFO_HISTORY))
            {
              if (bgp_debug_update(peer, p, NULL, 1))
 -                zlog_debug ("%s rcvd %s", peer->host,
 +                zlog_debug ("%s rcvd %s %s", peer->host,
                              bgp_debug_rdpfxpath2str (prd, p, addpath_id ? 1 : 0,
 -                                      addpath_id, pfx_buf, sizeof (pfx_buf)));
 +                                      addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf);
  
              if (bgp_damp_update (ri, rn, afi, safi) != BGP_DAMP_SUPPRESSED)
                {
                      peer->rcvd_attr_printed = 1;
                    }
  
 -                zlog_debug ("%s rcvd %s...duplicate ignored",
 +                zlog_debug ("%s rcvd %s %s...duplicate ignored",
                              peer->host,
                                bgp_debug_rdpfxpath2str (prd, p, addpath_id ?
 -                                1 : 0, addpath_id, pfx_buf, sizeof (pfx_buf)));
 +                                1 : 0, addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf);
                  }
  
              /* graceful restart STALE flag unset. */
        if (CHECK_FLAG(ri->flags, BGP_INFO_REMOVED))
          {
            if (bgp_debug_update(peer, p, NULL, 1))
 -            zlog_debug ("%s rcvd %s, flapped quicker than processing",
 +            zlog_debug ("%s rcvd %s %s, flapped quicker than processing",
                          peer->host,
                          bgp_debug_rdpfxpath2str (prd, p, addpath_id ? 1 : 0,
 -                                  addpath_id, pfx_buf, sizeof (pfx_buf)));
 +                                  addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf);
            bgp_info_restore (rn, ri);
          }
  
        /* Received Logging. */
        if (bgp_debug_update(peer, p, NULL, 1))
 -        zlog_debug ("%s rcvd %s", peer->host,
 +        zlog_debug ("%s rcvd %s %s", peer->host,
                        bgp_debug_rdpfxpath2str (prd, p, addpath_id ? 1 : 0,
 -                                        addpath_id, pfx_buf, sizeof (pfx_buf)));
 +                                        addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf);
  
        /* graceful restart STALE flag unset. */
        if (CHECK_FLAG (ri->flags, BGP_INFO_STALE))
        ri->attr = attr_new;
  
        /* Update MPLS tag.  */
 -      if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN)
 +      if (bgp_labeled_safi(safi))
          memcpy ((bgp_info_extra_get (ri))->tag, tag, 3);
  
  #if ENABLE_BGP_VNC
            }
        }
  
 -      /* Nexthop reachability check. */
 -      if ((afi == AFI_IP || afi == AFI_IP6) && safi == SAFI_UNICAST)
 +      /* Nexthop reachability check - for unicast and labeled-unicast.. */
 +      if ((afi == AFI_IP || afi == AFI_IP6) &&
 +          (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST))
        {
          if (peer->sort == BGP_PEER_EBGP && peer->ttl == 1 &&
              ! CHECK_FLAG (peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
            peer->rcvd_attr_printed = 1;
          }
  
 -      zlog_debug ("%s rcvd %s", peer->host,
 +      zlog_debug ("%s rcvd %s%s ", peer->host,
                    bgp_debug_rdpfxpath2str (prd, p, addpath_id ? 1 : 0,
 -                                 addpath_id, pfx_buf, sizeof (pfx_buf)));
 +                                 addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf);
      }
  
    /* Make new BGP info. */
    new = info_make(type, sub_type, 0, peer, attr_new, rn);
  
    /* Update MPLS tag. */
 -  if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN)
 +  if (bgp_labeled_safi(safi) || safi == SAFI_EVPN)
      memcpy ((bgp_info_extra_get (new))->tag, tag, 3);
  
    /* Update Overlay Index */
                             evpn==NULL?NULL:&evpn->gw_ip);
      }
    /* Nexthop reachability check. */
 -  if ((afi == AFI_IP || afi == AFI_IP6) && safi == SAFI_UNICAST)
 +  if ((afi == AFI_IP || afi == AFI_IP6) &&
 +       (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST))
      {
        if (peer->sort == BGP_PEER_EBGP && peer->ttl == 1 &&
          ! CHECK_FLAG (peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
            peer->rcvd_attr_printed = 1;
          }
  
 -      zlog_debug ("%s rcvd UPDATE about %s -- DENIED due to: %s",
 +      zlog_debug ("%s rcvd UPDATE about %s %s -- DENIED due to: %s",
                    peer->host,
                    bgp_debug_rdpfxpath2str (prd, p, addpath_id ? 1 : 0,
 -                             addpath_id, pfx_buf, sizeof (pfx_buf)), reason);
 +                             addpath_id, pfx_buf, sizeof (pfx_buf)), label_buf, reason);
      }
  
    if (ri)
@@@ -3089,6 -3008,9 +3089,6 @@@ bgp_announce_route_timer_expired (struc
    paf = THREAD_ARG (t);
    peer = paf->peer;
  
 -  assert (paf->t_announce_route);
 -  paf->t_announce_route = NULL;
 -
    if (peer->status != Established)
      return 0;
  
@@@ -3128,9 -3050,11 +3128,9 @@@ bgp_announce_route (struct peer *peer, 
     * multiple peers and the announcement doesn't happen in the
     * vty context.
     */
 -  THREAD_TIMER_MSEC_ON (bm->master, paf->t_announce_route,
 -                      bgp_announce_route_timer_expired, paf,
 -                        (subgrp->peer_count == 1) ?
 -                      BGP_ANNOUNCE_ROUTE_SHORT_DELAY_MS :
 -                      BGP_ANNOUNCE_ROUTE_DELAY_MS);
 +  thread_add_timer_msec(bm->master, bgp_announce_route_timer_expired, paf,
 +                        (subgrp->peer_count == 1) ? BGP_ANNOUNCE_ROUTE_SHORT_DELAY_MS : BGP_ANNOUNCE_ROUTE_DELAY_MS,
 +                        &paf->t_announce_route);
  }
  
  /*
@@@ -3778,9 -3702,9 +3778,9 @@@ bgp_static_free (struct bgp_static *bgp
    XFREE (MTYPE_BGP_STATIC, bgp_static);
  }
  
 -static void
 -bgp_static_update_main (struct bgp *bgp, struct prefix *p,
 -                      struct bgp_static *bgp_static, afi_t afi, safi_t safi)
 +void
 +bgp_static_update (struct bgp *bgp, struct prefix *p,
 +                   struct bgp_static *bgp_static, afi_t afi, safi_t safi)
  {
    struct bgp_node *rn;
    struct bgp_info *ri;
    if (bgp_static->atomic)
      attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE);
  
 +  /* Store label index, if required. */
 +  if (bgp_static->label_index != BGP_INVALID_LABEL_INDEX)
 +    {
 +      (bgp_attr_extra_get (&attr))->label_index = bgp_static->label_index;
 +      attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_PREFIX_SID);
 +    }
 +
    /* Apply route-map. */
    if (bgp_static->rmap.name)
      {
  #endif
  
          /* Nexthop reachability check. */
 -        if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK))
 +         if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) &&
 +              safi == SAFI_UNICAST)
            {
 -            if (bgp_find_or_add_nexthop (bgp, afi, ri, NULL, 0))
 +            if (bgp_find_or_add_nexthop (bgp, afi, ri, NULL, 0) &&
 +                  safi == SAFI_UNICAST)
                bgp_info_set_flag (rn, ri, BGP_INFO_VALID);
              else
                {
    bgp_attr_extra_free (&attr);
  }
  
 -void
 -bgp_static_update (struct bgp *bgp, struct prefix *p,
 -                  struct bgp_static *bgp_static, afi_t afi, safi_t safi)
 -{
 -  bgp_static_update_main (bgp, p, bgp_static, afi, safi);
 -}
 -
  void
  bgp_static_withdraw (struct bgp *bgp, struct prefix *p, afi_t afi,
                     safi_t safi)
@@@ -4236,8 -4158,7 +4236,8 @@@ bgp_static_update_safi (struct bgp *bgp
     route should be installed as valid.  */
  static int
  bgp_static_set (struct vty *vty, const char *ip_str, 
 -                afi_t afi, safi_t safi, const char *rmap, int backdoor)
 +                afi_t afi, safi_t safi, const char *rmap, int backdoor,
 +                u_int32_t label_index)
  {
    VTY_DECLVAR_CONTEXT(bgp, bgp);
    int ret;
        /* Configuration change. */
        bgp_static = rn->info;
  
 +      /* Label index cannot be changed. */
 +      if (bgp_static->label_index != label_index)
 +        {
 +          vty_out (vty, "%% Label index cannot be changed%s", VTY_NEWLINE);
 +          return CMD_WARNING;
 +        }
 +
        /* Check previous routes are installed into BGP.  */
        if (bgp_static->valid && bgp_static->backdoor != backdoor)
          need_update = 1;
        bgp_static->valid = 0;
        bgp_static->igpmetric = 0;
        bgp_static->igpnexthop.s_addr = 0;
 +      bgp_static->label_index = label_index;
        
        if (rmap)
        {
@@@ -4401,7 -4314,7 +4401,7 @@@ bgp_static_add (struct bgp *bgp
  
                for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm))
                  {
-                   bgp_static = rn->info;
+                   bgp_static = rm->info;
                      bgp_static_update_safi (bgp, &rm->p, bgp_static, afi, safi);
                  }
              }
@@@ -4435,7 -4348,7 +4435,7 @@@ bgp_static_delete (struct bgp *bgp
  
                for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm))
                  {
-                   bgp_static = rn->info;
+                   bgp_static = rm->info;
                    bgp_static_withdraw_safi (bgp, &rm->p,
                                               AFI_IP, safi,
                                               (struct prefix_rd *)&rn->p,
@@@ -4462,6 -4375,8 +4462,8 @@@ bgp_static_redo_import_check (struct bg
    afi_t afi;
    safi_t safi;
    struct bgp_node *rn;
+   struct bgp_node *rm;
+   struct bgp_table *table;
    struct bgp_static *bgp_static;
  
    /* Use this flag to force reprocessing of the route */
        for (rn = bgp_table_top (bgp->route[afi][safi]); rn; rn = bgp_route_next (rn))
        if (rn->info != NULL)
          {
-           bgp_static = rn->info;
-           bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
+           if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi == SAFI_EVPN))
+             {
+               table = rn->info;
+               for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm))
+                 {
+                   bgp_static = rm->info;
+                   bgp_static_update_safi (bgp, &rm->p, bgp_static, afi, safi);
+                 }
+             }
+           else
+             {
+               bgp_static = rn->info;
+               bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
+             }
          }
    bgp_flag_unset(bgp, BGP_FLAG_FORCE_STATIC_PROCESS);
  }
@@@ -4835,8 -4763,7 +4850,8 @@@ DEFUN (bgp_network
  {
    int idx_ipv4_prefixlen = 1;
    return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg,
 -                       AFI_IP, bgp_node_safi (vty), NULL, 0);
 +                       AFI_IP, bgp_node_safi (vty), NULL, 0,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_route_map,
    int idx_ipv4_prefixlen = 1;
    int idx_word = 3;
    return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg,
 -                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
 +                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_backdoor,
  {
    int idx_ipv4_prefixlen = 1;
    return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg, AFI_IP, SAFI_UNICAST,
 -                         NULL, 1);
 +                         NULL, 1, BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask,
      }
  
    return bgp_static_set (vty, prefix_str,
 -                       AFI_IP, bgp_node_safi (vty), NULL, 0);
 +                       AFI_IP, bgp_node_safi (vty), NULL, 0, BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask_route_map,
      }
  
    return bgp_static_set (vty, prefix_str,
 -                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
 +                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0, BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask_backdoor,
      }
  
    return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST,
 -                         NULL, 1);
 +                         NULL, 1,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask_natural,
      }
  
    return bgp_static_set (vty, prefix_str,
 -                       AFI_IP, bgp_node_safi (vty), NULL, 0);
 +                       AFI_IP, bgp_node_safi (vty), NULL, 0,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask_natural_route_map,
      }
  
    return bgp_static_set (vty, prefix_str,
 -                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
 +                       AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (bgp_network_mask_natural_backdoor,
      }
  
    return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST,
 -                         NULL, 1);
 +                         NULL, 1, BGP_INVALID_LABEL_INDEX);
 +}
 +
 +DEFUN (bgp_network_label_index,
 +       bgp_network_label_index_cmd,
 +       "network A.B.C.D/M label-index (0-4294967294)",
 +       "Specify a network to announce via BGP\n"
 +       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n")
 +{
 +  u_int32_t label_index;
 +
 +  VTY_GET_INTEGER ("label-index", label_index, argv[3]->arg);
 +  return bgp_static_set (vty, argv[1]->arg,
 +                         AFI_IP, bgp_node_safi (vty), NULL, 0, label_index);
 +}
 +
 +DEFUN (bgp_network_label_index_route_map,
 +       bgp_network_label_index_route_map_cmd,
 +       "network A.B.C.D/M label-index (0-4294967294) route-map WORD",
 +       "Specify a network to announce via BGP\n"
 +       "IP prefix\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n"
 +       "Route-map to modify the attributes\n"
 +       "Name of the route map\n")
 +{
 +  u_int32_t label_index;
 +
 +  VTY_GET_INTEGER ("label-index", label_index, argv[3]->arg);
 +  return bgp_static_set (vty, argv[1]->arg,
 +                         AFI_IP, bgp_node_safi (vty), argv[5]->arg, 0, label_index);
  }
  
  DEFUN (no_bgp_network,
@@@ -5112,26 -5003,6 +5127,26 @@@ DEFUN (no_bgp_network_mask_natural
                           bgp_node_safi (vty));
  }
  
 +ALIAS (no_bgp_network,
 +       no_bgp_network_label_index_cmd,
 +       "no network A.B.C.D/M label-index (0-4294967294)",
 +       NO_STR
 +       "Specify a network to announce via BGP\n"
 +       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n")
 +
 +ALIAS (no_bgp_network,
 +       no_bgp_network_label_index_route_map_cmd,
 +       "no network A.B.C.D/M label-index (0-4294967294) route-map WORD",
 +       NO_STR
 +       "Specify a network to announce via BGP\n"
 +       "IP prefix\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n"
 +       "Route-map to modify the attributes\n"
 +       "Name of the route map\n")
 +
  DEFUN (ipv6_bgp_network,
         ipv6_bgp_network_cmd,
         "network X:X::X:X/M",
  {
    int idx_ipv6_prefixlen = 1;
    return bgp_static_set (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty),
 -                         NULL, 0);
 +                         NULL, 0,
 +                         BGP_INVALID_LABEL_INDEX);
  }
  
  DEFUN (ipv6_bgp_network_route_map,
    int idx_ipv6_prefixlen = 1;
    int idx_word = 3;
    return bgp_static_set (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6,
 -                       bgp_node_safi (vty), argv[idx_word]->arg, 0);
 +                       bgp_node_safi (vty), argv[idx_word]->arg, 0,
 +                         BGP_INVALID_LABEL_INDEX);
 +}
 +
 +DEFUN (ipv6_bgp_network_label_index,
 +       ipv6_bgp_network_label_index_cmd,
 +       "network X:X::X:X/M label-index (0-4294967294)",
 +       "Specify a network to announce via BGP\n"
 +       "IPv6 prefix <network>/<length>\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n")
 +{
 +  u_int32_t label_index;
 +
 +  VTY_GET_INTEGER ("label-index", label_index, argv[3]->arg);
 +  return bgp_static_set (vty, argv[1]->arg,
 +                         AFI_IP6, bgp_node_safi (vty), NULL, 0, label_index);
 +}
 +
 +DEFUN (ipv6_bgp_network_label_index_route_map,
 +       ipv6_bgp_network_label_index_route_map_cmd,
 +       "network X:X::X:X/M label-index (0-4294967294) route-map WORD",
 +       "Specify a network to announce via BGP\n"
 +       "IPv6 prefix\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n"
 +       "Route-map to modify the attributes\n"
 +       "Name of the route map\n")
 +{
 +  u_int32_t label_index;
 +
 +  VTY_GET_INTEGER ("label-index", label_index, argv[3]->arg);
 +  return bgp_static_set (vty, argv[1]->arg,
 +                         AFI_IP6, bgp_node_safi (vty), argv[5]->arg, 0, label_index);
  }
  
  DEFUN (no_ipv6_bgp_network,
    return bgp_static_unset (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty));
  }
  
 +ALIAS (no_ipv6_bgp_network,
 +       no_ipv6_bgp_network_label_index_cmd,
 +       "no network X:X::X:X/M label-index (0-4294967294)",
 +       NO_STR
 +       "Specify a network to announce via BGP\n"
 +       "IPv6 prefix <network>/<length>\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n")
 +
 +ALIAS (no_ipv6_bgp_network,
 +       no_ipv6_bgp_network_label_index_route_map_cmd,
 +       "no network X:X::X:X/M label-index (0-4294967294) route-map WORD",
 +       NO_STR
 +       "Specify a network to announce via BGP\n"
 +       "IPv6 prefix\n"
 +       "Label index to associate with the prefix\n"
 +       "Label index value\n"
 +       "Route-map to modify the attributes\n"
 +       "Name of the route map\n")
 +
  /* Aggreagete address:
  
    advertise-map  Set condition to advertise attribute
@@@ -5753,11 -5570,9 +5768,11 @@@ bgp_aggregate_unset (struct vty *vty, c
      }
  
    aggregate = rn->info;
 -  if (aggregate->safi & SAFI_UNICAST)
 +  if (aggregate->safi == SAFI_UNICAST)
      bgp_aggregate_delete (bgp, &p, afi, SAFI_UNICAST, aggregate);
 -  if (aggregate->safi & SAFI_MULTICAST)
 +  if (aggregate->safi == SAFI_LABELED_UNICAST)
 +    bgp_aggregate_delete (bgp, &p, afi, SAFI_LABELED_UNICAST, aggregate);
 +  if (aggregate->safi == SAFI_MULTICAST)
      bgp_aggregate_delete (bgp, &p, afi, SAFI_MULTICAST, aggregate);
  
    /* Unlock aggregate address configuration. */
@@@ -5813,11 -5628,9 +5828,11 @@@ bgp_aggregate_set (struct vty *vty, con
    rn->info = aggregate;
  
    /* Aggregate address insert into BGP routing table. */
 -  if (safi & SAFI_UNICAST)
 +  if (safi == SAFI_UNICAST)
      bgp_aggregate_add (bgp, &p, afi, SAFI_UNICAST, aggregate);
 -  if (safi & SAFI_MULTICAST)
 +  if (safi == SAFI_LABELED_UNICAST)
 +    bgp_aggregate_add (bgp, &p, afi, SAFI_LABELED_UNICAST, aggregate);
 +  if (safi == SAFI_MULTICAST)
      bgp_aggregate_add (bgp, &p, afi, SAFI_MULTICAST, aggregate);
  
    return CMD_SUCCESS;
@@@ -5856,8 -5669,9 +5871,8 @@@ DEFUN (aggregate_address_mask
  {
    int idx = 0;
    argv_find (argv, argc, "A.B.C.D", &idx);
 -  char *prefix = argv[idx++]->arg;
 -  argv_find (argv, argc, "A.B.C.D", &idx);
 -  char *mask = argv[idx]->arg;
 +  char *prefix = argv[idx]->arg;
 +  char *mask = argv[idx+1]->arg;
    int as_set = argv_find (argv, argc, "as-set", &idx) ? AGGREGATE_AS_SET : 0;
    idx = 0;
    int summary_only = argv_find (argv, argc, "summary-only", &idx) ? AGGREGATE_SUMMARY_ONLY : 0;
@@@ -5905,8 -5719,9 +5920,8 @@@ DEFUN (no_aggregate_address_mask
  {
    int idx = 0;
    argv_find (argv, argc, "A.B.C.D", &idx);
 -  char *prefix = argv[idx++]->arg;
 -  argv_find (argv, argc, "A.B.C.D", &idx);
 -  char *mask = argv[idx]->arg;
 +  char *prefix = argv[idx]->arg;
 +  char *mask = argv[idx+1]->arg;
  
    char prefix_str[BUFSIZ];
    int ret = netmask_str2prefix_str (prefix, mask, prefix_str);
@@@ -7639,25 -7454,6 +7654,25 @@@ route_vty_out_detail (struct vty *vty, 
        if (binfo->extra && binfo->extra->damp_info)
        bgp_damp_info_vty (vty, binfo, json_path);
  
 +      /* Remove Label */
 +      if (bgp_labeled_safi(safi) && binfo->extra)
 +        {
 +          uint32_t label = label_pton(binfo->extra->tag);
 +          if (json_paths)
 +            json_object_int_add(json_path, "remoteLabel", label);
 +          else
 +            vty_out(vty, "      Remote label: %d%s", label, VTY_NEWLINE);
 +        }
 +
 +      /* Label Index */
 +      if (attr->extra->label_index != BGP_INVALID_LABEL_INDEX)
 +        {
 +          if (json_paths)
 +            json_object_int_add(json_path, "labelIndex", attr->extra->label_index);
 +          else
 +            vty_out(vty, "      Label Index: %d%s", attr->extra->label_index, VTY_NEWLINE);
 +        }
 +
        /* Line 8 display Addpath IDs */
        if (binfo->addpath_rx_id || binfo->addpath_tx_id)
          {
@@@ -8151,18 -7947,6 +8166,18 @@@ route_vty_out_detail_header (struct vt
               ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) ? ":" : "",
               buf2,
               p->prefixlen, VTY_NEWLINE);
 +
 +      if (bgp_labeled_safi(safi))
 +        {
 +          vty_out(vty, "Local label: ");
 +          if (!bgp_is_valid_label(rn->local_label))
 +            vty_out(vty, "not allocated%s", VTY_NEWLINE);
 +          else
 +            {
 +              uint32_t label = label_pton(rn->local_label);
 +              vty_out(vty, "%d%s", label, VTY_NEWLINE);
 +            }
 +        }
      }
  
    for (ri = rn->info; ri; ri = ri->next)
@@@ -8444,7 -8228,7 +8459,7 @@@ bgp_show_lcommunity_list (struct vty *v
  
  DEFUN (show_ip_bgp_large_community_list,
         show_ip_bgp_large_community_list_cmd,
 -       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community-list <(1-500)|WORD> [json]",
 +       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap|labeled-unicast>]] large-community-list <(1-500)|WORD> [json]",
         SHOW_STR
         IP_STR
         BGP_STR
         "Address Family modifier\n"
         "Address Family modifier\n"
         "Address Family modifier\n"
 +       "Address Family modifier\n"
         "Display routes matching the large-community-list\n"
         "large-community-list number\n"
         "large-community-list name\n"
  }
  DEFUN (show_ip_bgp_large_community,
         show_ip_bgp_large_community_cmd,
 -       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community [AA:BB:CC] [json]",
 +       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap|labeled-unicast>]] large-community [AA:BB:CC] [json]",
         SHOW_STR
         IP_STR
         BGP_STR
         "Address Family modifier\n"
         "Address Family modifier\n"
         "Address Family modifier\n"
 +       "Address Family modifier\n"
         "Display routes matching the large-communities\n"
         "List of large-community numbers\n"
         JSON_STR)
@@@ -8654,7 -8436,7 +8669,7 @@@ DEFUN (show_ip_bgp
      }
    /* prefix-longer */
    if (argv_find(argv, argc, "A.B.C.D/M", &idx) || argv_find(argv, argc, "X:X::X:X/M", &idx))
-     return bgp_show_prefix_longer (vty, bgp, argv[idx + 1]->arg, afi, safi, bgp_show_type_prefix_longer);
+     return bgp_show_prefix_longer (vty, bgp, argv[idx]->arg, afi, safi, bgp_show_type_prefix_longer);
  
    if (safi == SAFI_MPLS_VPN)
      return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, uj);
@@@ -9443,7 -9225,7 +9458,7 @@@ bgp_peer_counts (struct vty *vty, struc
  
  DEFUN (show_ip_bgp_instance_neighbor_prefix_counts,
         show_ip_bgp_instance_neighbor_prefix_counts_cmd,
 -       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] "
 +       "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap|labeled-unicast>]] "
         "neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json]",
         SHOW_STR
         IP_STR
         "Address Family modifier\n"
         "Address Family modifier\n"
         "Address Family modifier\n"
 +       "Address Family modifier\n"
         "Detailed information on TCP and BGP neighbor connections\n"
         "Neighbor to display information about\n"
         "Neighbor to display information about\n"
@@@ -10779,9 -10560,6 +10794,9 @@@ bgp_config_write_network (struct vty *v
                     p->prefixlen);
          }
  
 +        if (bgp_static->label_index != BGP_INVALID_LABEL_INDEX)
 +        vty_out (vty, " label-index %u", bgp_static->label_index);
 +
        if (bgp_static->rmap.name)
          vty_out (vty, " route-map %s", bgp_static->rmap.name);
        else 
@@@ -10908,8 -10686,6 +10923,8 @@@ bgp_route_init (void
    install_element (BGP_IPV4_NODE, &bgp_network_route_map_cmd);
    install_element (BGP_IPV4_NODE, &bgp_network_mask_route_map_cmd);
    install_element (BGP_IPV4_NODE, &bgp_network_mask_natural_route_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_network_label_index_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_network_label_index_route_map_cmd);
    install_element (BGP_IPV4_NODE, &no_bgp_table_map_cmd);
    install_element (BGP_IPV4_NODE, &no_bgp_network_cmd);
    install_element (BGP_IPV4_NODE, &no_bgp_network_mask_cmd);
    install_element (BGP_IPV4M_NODE, &no_aggregate_address_cmd);
    install_element (BGP_IPV4M_NODE, &no_aggregate_address_mask_cmd);
  
 +  /* IPv4 labeled-unicast configuration.  */
 +  install_element (BGP_IPV4L_NODE, &bgp_table_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_mask_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_mask_natural_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_route_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_mask_route_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_mask_natural_route_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_label_index_cmd);
 +  install_element (BGP_IPV4L_NODE, &bgp_network_label_index_route_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_table_map_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_network_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_network_mask_cmd);
 +  install_element (BGP_IPV4L_NODE, &no_bgp_network_mask_natural_cmd);
 +
    install_element (VIEW_NODE, &show_ip_bgp_instance_all_cmd);
    install_element (VIEW_NODE, &show_ip_bgp_cmd);
    install_element (VIEW_NODE, &show_ip_bgp_route_cmd);
    install_element (BGP_IPV6_NODE, &ipv6_bgp_network_route_map_cmd);
    install_element (BGP_IPV6_NODE, &no_bgp_table_map_cmd);
    install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_cmd);
 +  install_element (BGP_IPV6_NODE, &ipv6_bgp_network_label_index_cmd);
 +  install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_label_index_cmd);
 +  install_element (BGP_IPV6_NODE, &ipv6_bgp_network_label_index_route_map_cmd);
 +  install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_label_index_route_map_cmd);
  
    install_element (BGP_IPV6_NODE, &ipv6_aggregate_address_cmd);
    install_element (BGP_IPV6_NODE, &no_ipv6_aggregate_address_cmd);
    install_element (BGP_IPV6M_NODE, &ipv6_bgp_network_cmd);
    install_element (BGP_IPV6M_NODE, &no_ipv6_bgp_network_cmd);
  
 +  install_element (BGP_IPV6L_NODE, &bgp_table_map_cmd);
 +  install_element (BGP_IPV6L_NODE, &ipv6_bgp_network_cmd);
 +  install_element (BGP_IPV6L_NODE, &ipv6_bgp_network_route_map_cmd);
 +  install_element (BGP_IPV6L_NODE, &no_bgp_table_map_cmd);
 +  install_element (BGP_IPV6L_NODE, &no_ipv6_bgp_network_cmd);
 +
    install_element (BGP_NODE, &bgp_distance_cmd);
    install_element (BGP_NODE, &no_bgp_distance_cmd);
    install_element (BGP_NODE, &bgp_distance_source_cmd);
diff --combined vtysh/vtysh.c
index 3967cfc934a7ebadc3be97ba455f2b223e83a012,5bb969bef7988c55112d118526b38dd8108731f4..c28d57cff256f703c10de28723e988c12e00062f
@@@ -75,7 -75,6 +75,7 @@@ struct vtysh_client vtysh_client[] 
    { .fd = -1, .name = "isisd",    .flag = VTYSH_ISISD,    .next = NULL},
    { .fd = -1, .name = "pimd",     .flag = VTYSH_PIMD,     .next = NULL},
    { .fd = -1, .name = "nhrpd",    .flag = VTYSH_NHRPD,    .next = NULL},
 +  { .fd = -1, .name = "eigrpd",   .flag = VTYSH_EIGRPD,   .next = NULL},
    { .fd = -1, .name = "watchfrr", .flag = VTYSH_WATCHFRR, .next = NULL},
  };
  
@@@ -264,7 -263,7 +264,7 @@@ vtysh_pager_init (void
    if (pager_defined)
      vtysh_pager_name = strdup (pager_defined);
    else
 -    vtysh_pager_name = strdup ("more");
 +    vtysh_pager_name = strdup (VTYSH_PAGER);
  }
  
  /* Command execution over the vty interface. */
@@@ -310,8 -309,7 +310,8 @@@ vtysh_execute_func (const char *line, i
           || saved_node == BGP_ENCAP_NODE || saved_node == BGP_ENCAPV6_NODE
             || saved_node == BGP_IPV4_NODE
           || saved_node == BGP_IPV6_NODE || saved_node == BGP_IPV4M_NODE
 -         || saved_node == BGP_IPV6M_NODE || saved_node == BGP_EVPN_NODE)
 +         || saved_node == BGP_IPV4L_NODE || saved_node == BGP_IPV6L_NODE
 +           || saved_node == BGP_IPV6M_NODE || saved_node == BGP_EVPN_NODE)
          && (tried == 1))
        {
          vtysh_execute("exit-address-family");
@@@ -949,12 -947,6 +949,12 @@@ static struct cmd_node bgp_ipv4m_node 
    "%s(config-router-af)# "
  };
  
 +static struct cmd_node bgp_ipv4l_node =
 +{
 +  BGP_IPV4L_NODE,
 +  "%s(config-router-af)# "
 +};
 +
  static struct cmd_node bgp_ipv6_node =
  {
    BGP_IPV6_NODE,
@@@ -973,12 -965,6 +973,12 @@@ static struct cmd_node bgp_evpn_node 
    "%s(config-router-af)# "
  };
  
 +static struct cmd_node bgp_ipv6l_node =
 +{
 +  BGP_IPV6L_NODE,
 +  "%s(config-router-af)# "
 +};
 +
  static struct cmd_node bgp_vnc_defaults_node =
  {
    BGP_VNC_DEFAULTS_NODE,
@@@ -1008,12 -994,6 +1008,12 @@@ static struct cmd_node ospf_node 
    "%s(config-router)# "
  };
  
 +static struct cmd_node eigrp_node =
 +{
 +  EIGRP_NODE,
 +  "%s(config-router)# "
 +};
 +
  static struct cmd_node ripng_node =
  {
    RIPNG_NODE,
@@@ -1135,7 -1115,7 +1135,7 @@@ DEFUNSH (VTYSH_BGPD
         "address-family vpnv4 [unicast]",
         "Enter Address Family command mode\n"
         "Address Family\n"
 -       "Address Family Modifier\n")
 +       "Address Family modifier\n")
  {
    vty->node = BGP_VPNV4_NODE;
    return CMD_SUCCESS;
@@@ -1147,7 -1127,7 +1147,7 @@@ DEFUNSH (VTYSH_BGPD
         "address-family vpnv6 [unicast]",
         "Enter Address Family command mode\n"
         "Address Family\n"
 -       "Address Family Modifier\n")
 +       "Address Family modifier\n")
  {
    vty->node = BGP_VPNV6_NODE;
    return CMD_SUCCESS;
@@@ -1214,18 -1194,6 +1214,18 @@@ DEFUNSH (VTYSH_BGPD
    return CMD_SUCCESS;
  }
  
 +DEFUNSH (VTYSH_BGPD,
 +         address_family_ipv4_labeled_unicast,
 +         address_family_ipv4_labeled_unicast_cmd,
 +         "address-family ipv4 labeled-unicast",
 +         "Enter Address Family command mode\n"
 +         "Address Family\n"
 +         "Address Family modifier\n")
 +{
 +  vty->node = BGP_IPV4L_NODE;
 +  return CMD_SUCCESS;
 +}
 +
  DEFUNSH (VTYSH_BGPD,
           address_family_ipv6,
           address_family_ipv6_cmd,
@@@ -1262,18 -1230,6 +1262,18 @@@ DEFUNSH (VTYSH_BGPD
    return CMD_SUCCESS;
  }
  
 +DEFUNSH (VTYSH_BGPD,
 +         address_family_ipv6_labeled_unicast,
 +         address_family_ipv6_labeled_unicast_cmd,
 +         "address-family ipv6 labeled-unicast",
 +         "Enter Address Family command mode\n"
 +         "Address Family\n"
 +         "Address Family modifier\n")
 +{
 +  vty->node = BGP_IPV6L_NODE;
 +  return CMD_SUCCESS;
 +}
 +
  DEFUNSH (VTYSH_BGPD,
         address_family_evpn,
         address_family_evpn_cmd,
@@@ -1359,22 -1315,22 +1359,22 @@@ DEFUNSH (VTYSH_RIPD
  }
  
  DEFUNSH (VTYSH_RIPD,
-        router_rip,
-        router_rip_cmd,
-        "router rip",
-        ROUTER_STR
-        "RIP")
+          router_rip,
+          router_rip_cmd,
+          "router rip",
+          ROUTER_STR
+          "RIP\n")
  {
    vty->node = RIP_NODE;
    return CMD_SUCCESS;
  }
  
  DEFUNSH (VTYSH_RIPNGD,
-        router_ripng,
-        router_ripng_cmd,
-        "router ripng",
-        ROUTER_STR
-        "RIPng")
+          router_ripng,
+          router_ripng_cmd,
+          "router ripng",
+          ROUTER_STR
+          "RIPng\n")
  {
    vty->node = RIPNG_NODE;
    return CMD_SUCCESS;
@@@ -1392,18 -1348,6 +1392,18 @@@ DEFUNSH (VTYSH_OSPFD
    return CMD_SUCCESS;
  }
  
 +DEFUNSH (VTYSH_EIGRPD,
 +         router_eigrp,
 +         router_eigrp_cmd,
 +         "router eigrp (1-65535)",
 +         "Enable a routing process\n"
 +         "Start EIGRP configuration\n"
 +         "AS number to use\n")
 +{
 +  vty->node = EIGRP_NODE;
 +  return CMD_SUCCESS;
 +}
 +
  DEFUNSH (VTYSH_OSPF6D,
         router_ospf6,
         router_ospf6_cmd,
@@@ -1587,7 -1531,6 +1587,7 @@@ vtysh_exit (struct vty *vty
      case RIPNG_NODE:
      case OSPF_NODE:
      case OSPF6_NODE:
 +    case EIGRP_NODE:
      case LDP_NODE:
      case LDP_L2VPN_NODE:
      case ISIS_NODE:
      case BGP_ENCAPV6_NODE:
      case BGP_IPV4_NODE:
      case BGP_IPV4M_NODE:
 +    case BGP_IPV4L_NODE:
      case BGP_IPV6_NODE:
      case BGP_IPV6M_NODE:
 +    case BGP_IPV6L_NODE:
      case BGP_VRF_POLICY_NODE:
      case BGP_EVPN_NODE:
      case BGP_VNC_DEFAULTS_NODE:
@@@ -1667,13 -1608,11 +1667,13 @@@ DEFUNSH (VTYSH_BGPD
  {
    if (vty->node == BGP_IPV4_NODE
        || vty->node == BGP_IPV4M_NODE
 +      || vty->node == BGP_IPV4L_NODE
        || vty->node == BGP_VPNV4_NODE
        || vty->node == BGP_VPNV6_NODE
        || vty->node == BGP_ENCAP_NODE
        || vty->node == BGP_ENCAPV6_NODE
        || vty->node == BGP_IPV6_NODE
 +      || vty->node == BGP_IPV6L_NODE
        || vty->node == BGP_IPV6M_NODE)
      vty->node = BGP_NODE;
    return CMD_SUCCESS;
@@@ -1793,24 -1732,6 +1793,24 @@@ DEFUNSH (VTYSH_OSPFD
    return vtysh_exit_ospfd (self, vty, argc, argv);
  }
  
 +DEFUNSH (VTYSH_EIGRPD,
 +         vtysh_exit_eigrpd,
 +         vtysh_exit_eigrpd_cmd,
 +         "exit",
 +         "Exit current mode and down to previous mode\n")
 +{
 +  return vtysh_exit (vty);
 +}
 +
 +DEFUNSH (VTYSH_EIGRPD,
 +         vtysh_quit_eigrpd,
 +         vtysh_quit_eigrpd_cmd,
 +         "quit",
 +         "Exit current mode and down to previous mode\n")
 +{
 +  return vtysh_exit (vty);
 +}
 +
  DEFUNSH (VTYSH_OSPF6D,
         vtysh_exit_ospf6d,
         vtysh_exit_ospf6d_cmd,
@@@ -1894,7 -1815,7 +1894,7 @@@ DEFUNSH (VTYSH_INTERFACE
  }
  
  /* TODO Implement "no interface command in isisd. */
 -DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D,
 +DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_EIGRPD,
         vtysh_no_interface_cmd,
         "no interface IFNAME",
         NO_STR
@@@ -1978,13 -1899,13 +1978,13 @@@ DEFUNSH (VTYSH_VRF
  
  /* TODO Implement interface description commands in ripngd, ospf6d
   * and isisd. */
 -DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD,
 -       vtysh_interface_desc_cmd,
 +DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_EIGRPD,
 +      vtysh_interface_desc_cmd,
         "description LINE...",
         "Interface specific description\n"
         "Characters describing this interface\n")
         
 -DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD,
 +DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_EIGRPD,
         vtysh_no_interface_desc_cmd,
         "no description",
         NO_STR
@@@ -3219,17 -3140,14 +3219,17 @@@ vtysh_init_vty (void
    install_node (&bgp_encapv6_node, NULL);
    install_node (&bgp_ipv4_node, NULL);
    install_node (&bgp_ipv4m_node, NULL);
 +  install_node (&bgp_ipv4l_node, NULL);
    install_node (&bgp_ipv6_node, NULL);
    install_node (&bgp_ipv6m_node, NULL);
 +  install_node (&bgp_ipv6l_node, NULL);
    install_node (&bgp_vrf_policy_node, NULL);
    install_node (&bgp_evpn_node, NULL);
    install_node (&bgp_vnc_defaults_node, NULL);
    install_node (&bgp_vnc_nve_group_node, NULL);
    install_node (&bgp_vnc_l2_group_node, NULL);
    install_node (&ospf_node, NULL);
 +  install_node (&eigrp_node, NULL);
    install_node (&ripng_node, NULL);
    install_node (&ospf6_node, NULL);
    install_node (&ldp_node, NULL);
    vtysh_install_default (BGP_ENCAPV6_NODE);
    vtysh_install_default (BGP_IPV4_NODE);
    vtysh_install_default (BGP_IPV4M_NODE);
 +  vtysh_install_default (BGP_IPV4L_NODE);
    vtysh_install_default (BGP_IPV6_NODE);
    vtysh_install_default (BGP_IPV6M_NODE);
    vtysh_install_default (BGP_EVPN_NODE);
 +  vtysh_install_default (BGP_IPV6L_NODE);
  #if ENABLE_BGP_VNC
    vtysh_install_default (BGP_VRF_POLICY_NODE);
    vtysh_install_default (BGP_VNC_DEFAULTS_NODE);
    vtysh_install_default (BGP_VNC_L2_GROUP_NODE);
  #endif
    vtysh_install_default (OSPF_NODE);
 +  vtysh_install_default (EIGRP_NODE);
    vtysh_install_default (RIPNG_NODE);
    vtysh_install_default (OSPF6_NODE);
    vtysh_install_default (LDP_NODE);
    install_element (RIPNG_NODE, &vtysh_quit_ripngd_cmd);
    install_element (OSPF_NODE, &vtysh_exit_ospfd_cmd);
    install_element (OSPF_NODE, &vtysh_quit_ospfd_cmd);
 +  install_element (EIGRP_NODE, &vtysh_exit_eigrpd_cmd);
 +  install_element (EIGRP_NODE, &vtysh_quit_eigrpd_cmd);
    install_element (OSPF6_NODE, &vtysh_exit_ospf6d_cmd);
    install_element (OSPF6_NODE, &vtysh_quit_ospf6d_cmd);
  #if defined (HAVE_LDPD)
    install_element (BGP_IPV4_NODE, &vtysh_quit_bgpd_cmd);
    install_element (BGP_IPV4M_NODE, &vtysh_exit_bgpd_cmd);
    install_element (BGP_IPV4M_NODE, &vtysh_quit_bgpd_cmd);
 +  install_element (BGP_IPV4L_NODE, &vtysh_exit_bgpd_cmd);
 +  install_element (BGP_IPV4L_NODE, &vtysh_quit_bgpd_cmd);
    install_element (BGP_IPV6_NODE, &vtysh_exit_bgpd_cmd);
    install_element (BGP_IPV6_NODE, &vtysh_quit_bgpd_cmd);
    install_element (BGP_IPV6M_NODE, &vtysh_exit_bgpd_cmd);
    install_element (BGP_IPV6M_NODE, &vtysh_quit_bgpd_cmd);
    install_element (BGP_EVPN_NODE, &vtysh_quit_bgpd_cmd);
 +  install_element (BGP_IPV6L_NODE, &vtysh_exit_bgpd_cmd);
 +  install_element (BGP_IPV6L_NODE, &vtysh_quit_bgpd_cmd);
  #if defined (ENABLE_BGP_VNC)
    install_element (BGP_VRF_POLICY_NODE, &vtysh_exit_bgpd_cmd);
    install_element (BGP_VRF_POLICY_NODE, &vtysh_quit_bgpd_cmd);
    install_element (RIP_NODE, &vtysh_end_all_cmd);
    install_element (RIPNG_NODE, &vtysh_end_all_cmd);
    install_element (OSPF_NODE, &vtysh_end_all_cmd);
 +  install_element (EIGRP_NODE, &vtysh_end_all_cmd);
    install_element (OSPF6_NODE, &vtysh_end_all_cmd);
    install_element (LDP_NODE, &vtysh_end_all_cmd);
    install_element (LDP_IPV4_NODE, &vtysh_end_all_cmd);
    install_element (BGP_NODE, &vtysh_end_all_cmd);
    install_element (BGP_IPV4_NODE, &vtysh_end_all_cmd);
    install_element (BGP_IPV4M_NODE, &vtysh_end_all_cmd);
 +  install_element (BGP_IPV4L_NODE, &vtysh_end_all_cmd);
    install_element (BGP_VPNV4_NODE, &vtysh_end_all_cmd);
    install_element (BGP_VPNV6_NODE, &vtysh_end_all_cmd);
    install_element (BGP_ENCAP_NODE, &vtysh_end_all_cmd);
    install_element (BGP_ENCAPV6_NODE, &vtysh_end_all_cmd);
    install_element (BGP_IPV6_NODE, &vtysh_end_all_cmd);
    install_element (BGP_IPV6M_NODE, &vtysh_end_all_cmd);
 +  install_element (BGP_IPV6L_NODE, &vtysh_end_all_cmd);
    install_element (BGP_VRF_POLICY_NODE, &vtysh_end_all_cmd);
    install_element (BGP_EVPN_NODE, &vtysh_end_all_cmd);
    install_element (BGP_VNC_DEFAULTS_NODE, &vtysh_end_all_cmd);
    install_element (VRF_NODE, &vtysh_exit_vrf_cmd);
    install_element (VRF_NODE, &vtysh_quit_vrf_cmd);
  
 +  install_element (CONFIG_NODE, &router_eigrp_cmd);
    install_element (CONFIG_NODE, &router_rip_cmd);
    install_element (CONFIG_NODE, &router_ripng_cmd);
    install_element (CONFIG_NODE, &router_ospf_cmd);
    install_element (BGP_NODE, &address_family_ipv4_cmd);
    install_element (BGP_NODE, &address_family_ipv4_multicast_cmd);
    install_element (BGP_NODE, &address_family_ipv4_vpn_cmd);
 +  install_element (BGP_NODE, &address_family_ipv4_labeled_unicast_cmd);
    install_element (BGP_NODE, &address_family_ipv6_cmd);
    install_element (BGP_NODE, &address_family_ipv6_multicast_cmd);
    install_element (BGP_NODE, &address_family_ipv6_vpn_cmd);
 +  install_element (BGP_NODE, &address_family_ipv6_labeled_unicast_cmd);
    install_element (BGP_NODE, &address_family_evpn_cmd);
    install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
    install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);
    install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd);
    install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
    install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
 +  install_element (BGP_IPV4L_NODE, &exit_address_family_cmd);
    install_element (BGP_IPV6_NODE, &exit_address_family_cmd);
    install_element (BGP_IPV6M_NODE, &exit_address_family_cmd);
    install_element (BGP_EVPN_NODE, &exit_address_family_cmd);
 +  install_element (BGP_IPV6L_NODE, &exit_address_family_cmd);
  
    install_element (BGP_VRF_POLICY_NODE, &exit_vrf_policy_cmd);
    install_element (BGP_VNC_DEFAULTS_NODE, &exit_vnc_config_cmd);