mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 16:26:10 +00:00
lib: fix two filter cli problems
- Show the correct cisco style access list extended information. - `assert` action so static analyzer doesn't complain about possible NULL usage. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
744ad1afb4
commit
88b8bfdc8a
@ -505,14 +505,16 @@ void access_list_legacy_show(struct vty *vty, struct lyd_node *dnode,
|
|||||||
vty_out(vty, " any");
|
vty_out(vty, " any");
|
||||||
|
|
||||||
if (extended) {
|
if (extended) {
|
||||||
if (yang_dnode_exists(dnode, "./network")) {
|
if (yang_dnode_exists(dnode, "./destination-network")) {
|
||||||
yang_dnode_get_prefix(&p, dnode, "./network");
|
yang_dnode_get_prefix(&p, dnode,
|
||||||
|
"./destination-network");
|
||||||
masklen2ip(p.prefixlen, &mask);
|
masklen2ip(p.prefixlen, &mask);
|
||||||
vty_out(vty, " %pI4 %pI4", &p.u.prefix4, &mask);
|
vty_out(vty, " %pI4 %pI4", &p.u.prefix4, &mask);
|
||||||
} else if (yang_dnode_exists(dnode, "./host"))
|
} else if (yang_dnode_exists(dnode, "./destination-host"))
|
||||||
vty_out(vty, " host %s",
|
vty_out(vty, " host %s",
|
||||||
yang_dnode_get_string(dnode, "./host"));
|
yang_dnode_get_string(dnode,
|
||||||
else if (yang_dnode_exists(dnode, "./any"))
|
"./destination-host"));
|
||||||
|
else if (yang_dnode_exists(dnode, "./destination-any"))
|
||||||
vty_out(vty, " any");
|
vty_out(vty, " any");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1259,6 +1261,7 @@ static int plist_remove(struct vty *vty, const char *iptype, const char *name,
|
|||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
/* Use access-list data structure to fetch sequence. */
|
/* Use access-list data structure to fetch sequence. */
|
||||||
|
assert(action != NULL);
|
||||||
if (strcmp(action, "permit") == 0)
|
if (strcmp(action, "permit") == 0)
|
||||||
plt = PREFIX_PERMIT;
|
plt = PREFIX_PERMIT;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user