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

zebra: Fix ip protocol route-map issue. #17474

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion lib/route_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ZEBRA_ROUTE_VRRP, vrrp, vrrpd, '-', 0, 0, 0, "VRRP", vr
ZEBRA_ROUTE_NHG, zebra, none, '-', 0, 0, 0, "Nexthop Group", none
ZEBRA_ROUTE_SRTE, srte, none, '-', 0, 0, 0, "SR-TE", none
ZEBRA_ROUTE_TABLE_DIRECT, table-direct, zebra, 't', 1, 1, 1, "Table-Direct", zebra
ZEBRA_ROUTE_ALL, wildcard, none, '-', 0, 0, 0, "-", none
ZEBRA_ROUTE_ALL, any, none, '-', 0, 0, 0, "-", none


## help strings
Expand Down
15 changes: 3 additions & 12 deletions zebra/zebra_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3375,10 +3375,7 @@ int lib_vrf_zebra_filter_protocol_create(struct nb_cb_create_args *args)
const char *proto = yang_dnode_get_string(args->dnode, "protocol");
int rtype;

if (strcasecmp(proto, "any") == 0)
rtype = ZEBRA_ROUTE_MAX;
else
rtype = proto_name2num(proto);
rtype = proto_name2num(proto);

if (args->event == NB_EV_VALIDATE)
if (rtype < 0) {
Expand All @@ -3404,10 +3401,7 @@ int lib_vrf_zebra_filter_protocol_destroy(struct nb_cb_destroy_args *args)

yang_afi_safi_identity2value(afi_safi, &afi, &safi);

if (strcasecmp(proto, "any") == 0)
rtype = ZEBRA_ROUTE_MAX;
else
rtype = proto_name2num(proto);
rtype = proto_name2num(proto);

/* deleting an existing entry, it can't be invalid */
assert(rtype >= 0);
Expand Down Expand Up @@ -3435,10 +3429,7 @@ void lib_vrf_zebra_filter_protocol_apply_finish(

yang_afi_safi_identity2value(afi_safi, &afi, &safi);

if (strcasecmp(proto, "any") == 0)
rtype = ZEBRA_ROUTE_MAX;
else
rtype = proto_name2num(proto);
rtype = proto_name2num(proto);

/* finishing apply for a validated entry, it can't be invalid */
assert(rtype >= 0);
Expand Down
9 changes: 2 additions & 7 deletions zebra/zebra_routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ static void show_vrf_proto_rm(struct vty *vty, struct zebra_vrf *zvrf,
vty_out(vty, "%-24s : none\n", zebra_route_string(i));
}

if (PROTO_RM_NAME(zvrf, af_type, i))
vty_out(vty, "%-24s : %-10s\n", "any",
PROTO_RM_NAME(zvrf, af_type, i));
else
vty_out(vty, "%-24s : none\n", "any");
}

static void show_vrf_nht_rm(struct vty *vty, struct zebra_vrf *zvrf,
Expand Down Expand Up @@ -1222,8 +1217,8 @@ route_map_result_t zebra_route_map_check(afi_t family, struct route_entry *re,
return RMAP_DENYMATCH;
}
if (!rmap) {
rm_name = PROTO_RM_NAME(zvrf, family, ZEBRA_ROUTE_MAX);
rmap = PROTO_RM_MAP(zvrf, family, ZEBRA_ROUTE_MAX);
rm_name = PROTO_RM_NAME(zvrf, family, ZEBRA_ROUTE_ALL);
rmap = PROTO_RM_MAP(zvrf, family, ZEBRA_ROUTE_ALL);

if (rm_name && !rmap)
return RMAP_DENYMATCH;
Expand Down
Loading