diff options
| -rw-r--r-- | bgpd/bgp_attr.c | 16 | ||||
| -rw-r--r-- | bgpd/bgp_nht.c | 28 | ||||
| -rw-r--r-- | bgpd/bgp_route.c | 10 | ||||
| -rw-r--r-- | bgpd/bgp_vty.c | 110 | ||||
| -rw-r--r-- | bgpd/rfapi/vnc_import_bgp.c | 17 | ||||
| -rw-r--r-- | lib/thread.c | 4 | ||||
| -rwxr-xr-x | vtysh/extract.pl.in | 4 | ||||
| -rw-r--r-- | vtysh/vtysh.c | 55 | ||||
| -rw-r--r-- | vtysh/vtysh.h | 2 | ||||
| -rw-r--r-- | vtysh/vtysh_main.c | 8 |
10 files changed, 190 insertions, 64 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index b1b245d42c..7741f76a75 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2171,8 +2171,10 @@ bgp_attr_encap( stlv_last = tlv; } - if (attre && (BGP_ATTR_ENCAP == type)) { - attre->encap_tunneltype = tunneltype; + if (BGP_ATTR_ENCAP == type) { + if (!attre) + attre = bgp_attr_extra_get(attr); + attre->encap_tunneltype = tunneltype; } if (length) { @@ -2777,7 +2779,10 @@ bgp_packet_mpattr_tea( struct bgp_attr_encap_subtlv *st; const char *attrname; - if (!attr || !attr->extra) + if (!attr || !attr->extra || + (attrtype == BGP_ATTR_ENCAP && + (!attr->extra->encap_tunneltype || + attr->extra->encap_tunneltype == BGP_ENCAP_TYPE_MPLS))) return; switch (attrtype) { @@ -2808,11 +2813,6 @@ bgp_packet_mpattr_tea( assert(0); } - - /* if no tlvs, don't make attr */ - if (subtlvs == NULL) - return; - /* compute attr length */ for (st = subtlvs; st; st = st->next) { attrlenfield += (attrhdrlen + st->length); diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 1ca0483678..4c4fbc09b5 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -69,6 +69,14 @@ bgp_find_nexthop (struct bgp_info *path, int connected) if (!bnc) return 0; + /* + * We are cheating here. Views have no associated underlying + * ability to detect nexthops. So when we have a view + * just tell everyone the nexthop is valid + */ + if (path->peer && path->peer->bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) + return 1; + if (connected && !(CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))) return 0; @@ -196,7 +204,6 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri, bnc = rn->info; bgp_unlock_node (rn); - if (is_bgp_static_route) { SET_FLAG(bnc->flags, BGP_STATIC_ROUTE); @@ -239,10 +246,13 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri, UNSET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED); UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID); } - - if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED)) + if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) + { + bnc->flags |= BGP_NEXTHOP_REGISTERED; + bnc->flags |= BGP_NEXTHOP_VALID; + } + else if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED)) register_zebra_rnh(bnc, is_bgp_static_route); - if (ri && ri->nexthop != bnc) { /* Unlink from existing nexthop cache, if any. This will also free @@ -260,7 +270,15 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri, else if (peer) bnc->nht_info = (void *)peer; /* NHT peer reference */ - return (bgp_isvalid_nexthop(bnc)); + /* + * We are cheating here. Views have no associated underlying + * ability to detect nexthops. So when we have a view + * just tell everyone the nexthop is valid + */ + if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) + return 1; + else + return (bgp_isvalid_nexthop(bnc)); } void diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 29953cae02..3e5251a7ff 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8208,6 +8208,15 @@ DEFUN (show_ip_bgp, return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, use_json(argc, argv)); } +ALIAS (show_ip_bgp, + show_bgp_ipv4_cmd, + "show bgp ipv4 {json}", + SHOW_STR + IP_STR + BGP_STR + "Address family\n" + "JavaScript Object Notation\n") + DEFUN (show_ip_bgp_ipv4, show_ip_bgp_ipv4_cmd, "show ip bgp ipv4 (unicast|multicast) {json}", @@ -14753,6 +14762,7 @@ bgp_route_init (void) install_element (BGP_IPV4M_NODE, &no_aggregate_address_mask_summary_as_set_cmd); install_element (VIEW_NODE, &show_ip_bgp_cmd); + install_element (VIEW_NODE, &show_bgp_ipv4_cmd); install_element (VIEW_NODE, &show_ip_bgp_instance_cmd); install_element (VIEW_NODE, &show_ip_bgp_instance_all_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_cmd); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 79e5a0c332..39933a1953 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -115,11 +115,9 @@ bgp_vty_afi_from_arg(const char *afi_str) if (!strcmp(afi_str, "ipv4")) { afi = AFI_IP; } -#ifdef HAVE_IPV6 else if (!strcmp(afi_str, "ipv6")) { afi = AFI_IP6; } -#endif /* HAVE_IPV6 */ return afi; } @@ -167,11 +165,9 @@ peer_address_self_check (struct bgp *bgp, union sockunion *su) if (su->sa.sa_family == AF_INET) ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr, bgp->vrf_id); -#ifdef HAVE_IPV6 else if (su->sa.sa_family == AF_INET6) ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr, su->sin6.sin6_scope_id, bgp->vrf_id); -#endif /* HAVE IPV6 */ if (ifp) return 1; @@ -2601,14 +2597,12 @@ DEFUN (bgp_listen_range, afi = family2afi(range.family); -#ifdef HAVE_IPV6 if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { vty_out (vty, "%% Malformed listen range (link-local address)%s", VTY_NEWLINE); return CMD_WARNING; } -#endif /* HAVE_IPV6 */ apply_mask (&range); @@ -2673,14 +2667,12 @@ DEFUN (no_bgp_listen_range, afi = family2afi(range.family); -#ifdef HAVE_IPV6 if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { vty_out (vty, "%% Malformed listen range (link-local address)%s", VTY_NEWLINE); return CMD_WARNING; } -#endif /* HAVE_IPV6 */ apply_mask (&range); @@ -6076,7 +6068,7 @@ DEFUN (address_family_ipv4, DEFUN (address_family_ipv4_safi, address_family_ipv4_safi_cmd, - "address-family ipv4 "BGP_SAFI_CMD_STR, + "address-family ipv4 (unicast|multicast|vpn|encap)", "Enter Address Family command mode\n" "Address Family\n" BGP_SAFI_HELP_STR) @@ -6113,7 +6105,7 @@ DEFUN (address_family_ipv6, DEFUN (address_family_ipv6_safi, address_family_ipv6_safi_cmd, - "address-family ipv6 "BGP_SAFI_CMD_STR, + "address-family ipv6 (unicast|multicast|vpn|encap)", "Enter Address Family command mode\n" "Address Family\n" BGP_SAFI_HELP_STR) @@ -10170,7 +10162,9 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, if (safi == SAFI_MPLS_VPN) /* handle special cases to match zebra.h */ safi = SAFI_ENCAP; else - safi++; + safi++; + if (safi == SAFI_RESERVED_3) /* handle special cases to match zebra.h */ + safi++; if (! safi_wildcard) safi = SAFI_MAX; } @@ -10272,7 +10266,7 @@ DEFUN (show_ip_bgp_summary, "JavaScript Object Notation\n") { u_char uj = use_json(argc, argv); - return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MAX, uj); + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST, uj); } DEFUN (show_ip_bgp_instance_summary, @@ -10286,7 +10280,7 @@ DEFUN (show_ip_bgp_instance_summary, "JavaScript Object Notation\n") { u_char uj = use_json(argc, argv); - return bgp_show_summary_vty (vty, argv[1], AFI_IP, SAFI_MAX, uj); + return bgp_show_summary_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, uj); } DEFUN (show_ip_bgp_instance_all_summary, @@ -10301,7 +10295,7 @@ DEFUN (show_ip_bgp_instance_all_summary, { u_char uj = use_json(argc, argv); - bgp_show_all_instances_summary_vty (vty, AFI_IP, SAFI_MAX, uj); + bgp_show_all_instances_summary_vty (vty, AFI_IP, SAFI_UNICAST, uj); return CMD_SUCCESS; } @@ -10328,7 +10322,8 @@ ALIAS (show_ip_bgp_ipv4_summary, BGP_STR "Address family\n" BGP_SAFI_HELP_STR - "Summary of BGP neighbor status\n") + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") DEFUN (show_ip_bgp_instance_ipv4_summary, show_ip_bgp_instance_ipv4_summary_cmd, @@ -10359,7 +10354,6 @@ ALIAS (show_ip_bgp_instance_ipv4_summary, BGP_AFI_SAFI_HELP_STR "Summary of BGP neighbor status\n") -#ifdef HAVE_IPV6 DEFUN (show_bgp_summary, show_bgp_summary_cmd, "show bgp summary {json}", @@ -10398,25 +10392,78 @@ DEFUN (show_bgp_instance_all_summary, return CMD_SUCCESS; } +DEFUN (show_bgp_ipv4_summary, + show_bgp_ipv4_summary_cmd, + "show bgp ipv4 summary {json}", + SHOW_STR + BGP_STR + "Address family\n" + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") +{ + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MAX, use_json(argc, argv)); +} + +DEFUN (show_bgp_instance_ipv4_summary, + show_bgp_instance_ipv4_summary_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv4 summary {json}", + SHOW_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "Address family\n" + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") +{ + return bgp_show_summary_vty (vty, argv[1], AFI_IP, SAFI_MAX, use_json(argc, argv)); +} + +DEFUN (show_bgp_instance_ipv4_all_summary, + show_bgp_instance_ipv4_all_summary_cmd, + "show bgp " BGP_INSTANCE_ALL_CMD " ipv4 summary {json}", + SHOW_STR + BGP_STR + BGP_INSTANCE_ALL_HELP_STR + "Address family\n" + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") +{ + return bgp_show_summary_vty (vty, argv[1], AFI_IP, SAFI_MAX, use_json(argc, argv)); +} + DEFUN (show_bgp_ipv6_summary, show_bgp_ipv6_summary_cmd, "show bgp ipv6 summary {json}", SHOW_STR BGP_STR "Address family\n" - "Summary of BGP neighbor status\n") + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") { return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MAX, use_json(argc, argv)); } -DEFUN (show_bgp_instance_ipv6__summary, +DEFUN (show_bgp_instance_ipv6_summary, show_bgp_instance_ipv6_summary_cmd, "show bgp " BGP_INSTANCE_CMD " ipv6 summary {json}", SHOW_STR BGP_STR BGP_INSTANCE_HELP_STR "Address family\n" - "Summary of BGP neighbor status\n") + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") +{ + return bgp_show_summary_vty (vty, argv[1], AFI_IP6, SAFI_MAX, use_json(argc, argv)); +} + +DEFUN (show_bgp_instance_ipv6_all_summary, + show_bgp_instance_ipv6_all_summary_cmd, + "show bgp " BGP_INSTANCE_ALL_CMD " ipv6 summary {json}", + SHOW_STR + BGP_STR + BGP_INSTANCE_ALL_HELP_STR + "Address family\n" + "Summary of BGP neighbor status\n" + "JavaScript Object Notation\n") { return bgp_show_summary_vty (vty, argv[1], AFI_IP6, SAFI_MAX, use_json(argc, argv)); } @@ -10463,7 +10510,7 @@ DEFUN (show_ipv6_bgp_summary, "JavaScript Object Notation\n") { u_char uj = use_json(argc, argv); - return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MAX, uj); + return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, uj); } /* old command */ @@ -10479,7 +10526,6 @@ DEFUN (show_ipv6_mbgp_summary, u_char uj = use_json(argc, argv); return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST, uj); } -#endif /* HAVE_IPV6 */ const char * afi_safi_print (afi_t afi, safi_t safi) @@ -11307,7 +11353,6 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js || p->afc_recv[AFI_IP][SAFI_UNICAST] || p->afc_adv[AFI_IP][SAFI_MULTICAST] || p->afc_recv[AFI_IP][SAFI_MULTICAST] -#ifdef HAVE_IPV6 || p->afc_adv[AFI_IP6][SAFI_UNICAST] || p->afc_recv[AFI_IP6][SAFI_UNICAST] || p->afc_adv[AFI_IP6][SAFI_MULTICAST] @@ -11316,7 +11361,6 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN] || p->afc_adv[AFI_IP6][SAFI_ENCAP] || p->afc_recv[AFI_IP6][SAFI_ENCAP] -#endif /* HAVE_IPV6 */ || p->afc_adv[AFI_IP][SAFI_ENCAP] || p->afc_recv[AFI_IP][SAFI_ENCAP] || p->afc_adv[AFI_IP][SAFI_MPLS_VPN] @@ -12074,21 +12118,18 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (use_json) { json_object_string_add(json_neigh, "nexthop", inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ)); -#ifdef HAVE_IPV6 json_object_string_add(json_neigh, "nexthopGlobal", inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ)); json_object_string_add(json_neigh, "nexthopLocal", inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ)); if (p->shared_network) json_object_string_add(json_neigh, "bgpConnection", "sharedNetwork"); else json_object_string_add(json_neigh, "bgpConnection", "nonSharedNetwork"); -#endif /* HAVE_IPV6 */ } else { vty_out (vty, "Nexthop: %s%s", inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ), VTY_NEWLINE); -#ifdef HAVE_IPV6 vty_out (vty, "Nexthop global: %s%s", inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ), VTY_NEWLINE); @@ -12098,7 +12139,6 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js vty_out (vty, "BGP connection: %s%s", p->shared_network ? "shared network" : "non shared network", VTY_NEWLINE); -#endif /* HAVE_IPV6 */ } } @@ -13649,7 +13689,6 @@ ALIAS (no_bgp_redistribute_ipv4, "Route map reference\n" "Pointer to route-map entries\n") -#ifdef HAVE_IPV6 DEFUN (bgp_redistribute_ipv6, bgp_redistribute_ipv6_cmd, "redistribute " FRR_IP6_REDIST_STR_BGPD, @@ -13831,7 +13870,6 @@ ALIAS (no_bgp_redistribute_ipv6, "Default metric\n" "Route map reference\n" "Pointer to route-map entries\n") -#endif /* HAVE_IPV6 */ int bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, @@ -15108,17 +15146,13 @@ bgp_vty_init (void) /* address-family commands. */ install_element (BGP_NODE, &address_family_ipv4_cmd); install_element (BGP_NODE, &address_family_ipv4_safi_cmd); -#ifdef HAVE_IPV6 install_element (BGP_NODE, &address_family_ipv6_cmd); install_element (BGP_NODE, &address_family_ipv6_safi_cmd); -#endif /* HAVE_IPV6 */ install_element (BGP_NODE, &address_family_vpnv4_cmd); install_element (BGP_NODE, &address_family_vpnv6_cmd); install_element (BGP_NODE, &address_family_encap_cmd); install_element (BGP_NODE, &address_family_encapv4_cmd); -#ifdef HAVE_IPV6 install_element (BGP_NODE, &address_family_encapv6_cmd); -#endif /* "exit-address-family" command. */ install_element (BGP_IPV4_NODE, &exit_address_family_cmd); @@ -15425,15 +15459,17 @@ bgp_vty_init (void) install_element (VIEW_NODE, &show_bgp_ipv4_safi_summary_cmd); install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_summary_cmd); -#ifdef HAVE_IPV6 + install_element (VIEW_NODE, &show_bgp_ipv4_summary_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv4_summary_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv4_all_summary_cmd); install_element (VIEW_NODE, &show_bgp_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_all_summary_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_all_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_summary_cmd); -#endif /* HAVE_IPV6 */ /* "show ip bgp neighbors" commands. */ install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd); @@ -15444,7 +15480,6 @@ bgp_vty_init (void) install_element (VIEW_NODE, &show_ip_bgp_instance_all_neighbors_cmd); install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); -#ifdef HAVE_IPV6 install_element (VIEW_NODE, &show_bgp_neighbors_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd); install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd); @@ -15457,7 +15492,6 @@ bgp_vty_init (void) /* Old commands. */ install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd); install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd); -#endif /* HAVE_IPV6 */ /* "show ip bgp peer-group" commands. */ install_element (VIEW_NODE, &show_ip_bgp_peer_groups_cmd); @@ -15516,7 +15550,6 @@ bgp_vty_init (void) install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd); install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd); install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd); -#ifdef HAVE_IPV6 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd); install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd); @@ -15527,7 +15560,6 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd); -#endif /* HAVE_IPV6 */ /* ttl_security commands */ install_element (BGP_NODE, &neighbor_ttl_security_cmd); diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 867c27fc63..d5ca965465 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -466,6 +466,10 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( struct bgp_attr_encap_subtlv *encaptlvs; uint32_t label = 0; + struct rfapi_un_option optary[3]; + struct rfapi_un_option *opt = NULL; + int cur_opt = 0; + vnc_zlog_debug_verbose ("%s: entry", __func__); if (bi->type != ZEBRA_ROUTE_BGP && bi->type != ZEBRA_ROUTE_BGP_DIRECT) @@ -509,6 +513,17 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( if (bi->attr && bi->attr->extra) { encaptlvs = bi->attr->extra->vnc_subtlvs; + if (bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_RESERVED && + bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_MPLS) + { + if (opt != NULL) + opt->next = &optary[cur_opt]; + opt = &optary[cur_opt++]; + memset (opt, 0, sizeof (struct rfapi_un_option)); + opt->type = RFAPI_UN_OPTION_TYPE_TUNNELTYPE; + opt->v.tunnel.type = bi->attr->extra->encap_tunneltype; + /* TBD parse bi->attr->extra->encap_subtlvs */ + } } else { @@ -533,7 +548,7 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( local_pref, plifetime, (struct bgp_tea_options *) encaptlvs, /* RFP options */ - NULL, + opt, NULL, new_ecom, med, /* NULL => don't set med */ diff --git a/lib/thread.c b/lib/thread.c index 6ada7cd96a..5b8778b717 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -489,8 +489,8 @@ thread_master_create (void) #if defined(HAVE_POLL) rv->handler.pfdsize = rv->fd_limit; rv->handler.pfdcount = 0; - rv->handler.pfds = (struct pollfd *) malloc (sizeof (struct pollfd) * rv->handler.pfdsize); - memset (rv->handler.pfds, 0, sizeof (struct pollfd) * rv->handler.pfdsize); + rv->handler.pfds = XCALLOC (MTYPE_THREAD_MASTER, + sizeof (struct pollfd) * rv->handler.pfdsize); #endif return rv; } diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index 9813b19ced..8842f3f5d0 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -53,9 +53,9 @@ $ignore{'"router bgp " "<1-4294967295>" " (view|vrf) WORD"'} = "ignore"; $ignore{'"router isis WORD"'} = "ignore"; $ignore{'"router zebra"'} = "ignore"; $ignore{'"address-family ipv4"'} = "ignore"; -$ignore{'"address-family ipv4 (unicast|multicast)"'} = "ignore"; +$ignore{'"address-family ipv4 (unicast|multicast|vpn|encap)"'} = "ignore"; $ignore{'"address-family ipv6"'} = "ignore"; -$ignore{'"address-family ipv6 (unicast|multicast)"'} = "ignore"; +$ignore{'"address-family ipv6 (unicast|multicast|vpn|encap)"'} = "ignore"; $ignore{'"address-family ipv4 vpn"'} = "ignore"; $ignore{'"address-family vpnv4"'} = "ignore"; $ignore{'"address-family vpnv4 unicast"'} = "ignore"; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 17f6bfa5a5..6f9273e889 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1216,6 +1216,31 @@ DEFUNSH (VTYSH_BGPD, } DEFUNSH (VTYSH_BGPD, + address_family_ipv4_encap, + address_family_ipv4_encap_cmd, + "address-family ipv4 encap", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_ENCAP_NODE; + return CMD_SUCCESS; +} + +DEFUNSH (VTYSH_BGPD, + address_family_ipv4_vpn, + address_family_ipv4_vpn_cmd, + "address-family ipv4 vpn", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_VPNV4_NODE; + return CMD_SUCCESS; +} + + +DEFUNSH (VTYSH_BGPD, address_family_ipv6, address_family_ipv6_cmd, "address-family ipv6", @@ -1250,6 +1275,30 @@ DEFUNSH (VTYSH_BGPD, return CMD_SUCCESS; } +DEFUNSH (VTYSH_BGPD, + address_family_ipv6_encap, + address_family_ipv6_encap_cmd, + "address-family ipv6 encap", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_ENCAPV6_NODE; + return CMD_SUCCESS; +} + +DEFUNSH (VTYSH_BGPD, + address_family_ipv6_vpn, + address_family_ipv6_vpn_cmd, + "address-family ipv6 vpn", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_VPNV6_NODE; + return CMD_SUCCESS; +} + #if defined (ENABLE_BGP_VNC) DEFUNSH (VTYSH_BGPD, vnc_defaults, @@ -3373,11 +3422,13 @@ vtysh_init_vty (void) #endif install_element (BGP_NODE, &address_family_ipv4_unicast_cmd); install_element (BGP_NODE, &address_family_ipv4_multicast_cmd); -#ifdef HAVE_IPV6 + install_element (BGP_NODE, &address_family_ipv4_encap_cmd); + install_element (BGP_NODE, &address_family_ipv4_vpn_cmd); install_element (BGP_NODE, &address_family_ipv6_cmd); install_element (BGP_NODE, &address_family_ipv6_unicast_cmd); install_element (BGP_NODE, &address_family_ipv6_multicast_cmd); -#endif + install_element (BGP_NODE, &address_family_ipv6_encap_cmd); + install_element (BGP_NODE, &address_family_ipv6_vpn_cmd); install_element (BGP_VPNV4_NODE, &exit_address_family_cmd); install_element (BGP_VPNV6_NODE, &exit_address_family_cmd); install_element (BGP_ENCAP_NODE, &exit_address_family_cmd); diff --git a/vtysh/vtysh.h b/vtysh/vtysh.h index 537f944a7a..39bf64f307 100644 --- a/vtysh/vtysh.h +++ b/vtysh/vtysh.h @@ -49,7 +49,7 @@ DECLARE_MGROUP(MVTYSH) /* vtysh local configuration file. */ #define VTYSH_DEFAULT_CONFIG "vtysh.conf" -#define QUAGGA_DEFAULT_CONFIG "Quagga.conf" +#define FRR_DEFAULT_CONFIG "Frr.conf" enum vtysh_write_integrated { WRITE_INTEGRATED_UNSPECIFIED, diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index 78b17be058..127cb70ad5 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -46,7 +46,7 @@ char *progname; /* Configuration file name and directory. */ static char vtysh_config_always[MAXPATHLEN] = SYSCONFDIR VTYSH_DEFAULT_CONFIG; -static char quagga_config_default[MAXPATHLEN] = SYSCONFDIR QUAGGA_DEFAULT_CONFIG; +static char quagga_config_default[MAXPATHLEN] = SYSCONFDIR FRR_DEFAULT_CONFIG; char *quagga_config = quagga_config_default; char history_file[MAXPATHLEN]; @@ -357,17 +357,17 @@ main (int argc, char **argv, char **env) /* * Overwrite location for Quagga.conf */ - vtysh_configfile_name = strrchr(QUAGGA_DEFAULT_CONFIG, '/'); + vtysh_configfile_name = strrchr(FRR_DEFAULT_CONFIG, '/'); if (vtysh_configfile_name) /* skip '/' */ vtysh_configfile_name++; else /* - * QUAGGA_DEFAULT_CONFIG configured with relative path + * FRR_DEFAULT_CONFIG configured with relative path * during config? Should really never happen for * sensible config */ - vtysh_configfile_name = (char *) QUAGGA_DEFAULT_CONFIG; + vtysh_configfile_name = (char *) FRR_DEFAULT_CONFIG; strlcpy(quagga_config_default, optarg, sizeof(vtysh_config_always)); strlcat(quagga_config_default, "/", sizeof(vtysh_config_always)); strlcat(quagga_config_default, vtysh_configfile_name, |
