bgpd: community_list_set str is always non null

When calling community_list_set the str variable is
always non NULL.  As such let's treat it as such.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-05-30 19:30:12 -04:00
parent 3f1b34c498
commit 1f7038386e
2 changed files with 8 additions and 8 deletions

View File

@ -899,7 +899,6 @@ int community_list_set(struct community_list_handler *ch, const char *name,
}
}
if (str) {
if (style == COMMUNITY_LIST_STANDARD)
com = community_str2com(str);
else
@ -907,7 +906,6 @@ int community_list_set(struct community_list_handler *ch, const char *name,
if (!com && !regex)
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
}
entry = community_entry_new();
entry->direct = direct;

View File

@ -20663,6 +20663,7 @@ DEFUN (community_list_standard,
argv_find(argv, argc, "AA:NN", &idx);
char *str = argv_concat(argv, argc, idx);
assert(str);
int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq,
direct, style);
@ -20775,6 +20776,7 @@ DEFUN (community_list_expanded_all,
argv_find(argv, argc, "AA:NN", &idx);
char *str = argv_concat(argv, argc, idx);
assert(str);
int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq,
direct, style);