Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master: Fix a couple of issues - rfapi/show vpn issues #159

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -6653,10 +6653,10 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
}
}
bgp_show_summary (vty, bgp, afi, safi, use_json, json);
if (safi == SAFI_MPLS_VPN) /* handle special cases to match zebra.h */
safi = SAFI_ENCAP;
else
safi++;
safi++;
if (safi == SAFI_RESERVED_4 ||
safi == SAFI_RESERVED_5) /* handle special cases to match zebra.h */
safi++;
if (! safi_wildcard)
safi = SAFI_MAX;
}
Expand Down
16 changes: 15 additions & 1 deletion bgpd/rfapi/vnc_import_bgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,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)
Expand Down Expand Up @@ -510,6 +514,16 @@ 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_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
{
Expand All @@ -534,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 */
Expand Down