forked from Mirror/frr
lib: argv update for distribute.c and ns.c
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
parent
b823bd432c
commit
c0c053fa13
|
@ -148,7 +148,7 @@ distribute_cmp (const struct distribute *dist1, const struct distribute *dist2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set access-list name to the distribute list. */
|
/* Set access-list name to the distribute list. */
|
||||||
static struct distribute *
|
static void
|
||||||
distribute_list_set (const char *ifname, enum distribute_type type,
|
distribute_list_set (const char *ifname, enum distribute_type type,
|
||||||
const char *alist_name)
|
const char *alist_name)
|
||||||
{
|
{
|
||||||
|
@ -171,8 +171,6 @@ distribute_list_set (const char *ifname, enum distribute_type type,
|
||||||
|
|
||||||
/* Apply this distribute-list to the interface. */
|
/* Apply this distribute-list to the interface. */
|
||||||
(*distribute_add_hook) (dist);
|
(*distribute_add_hook) (dist);
|
||||||
|
|
||||||
return dist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unset distribute-list. If matched distribute-list exist then
|
/* Unset distribute-list. If matched distribute-list exist then
|
||||||
|
@ -226,7 +224,7 @@ distribute_list_unset (const char *ifname, enum distribute_type type,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set access-list name to the distribute list. */
|
/* Set access-list name to the distribute list. */
|
||||||
static struct distribute *
|
static void
|
||||||
distribute_list_prefix_set (const char *ifname, enum distribute_type type,
|
distribute_list_prefix_set (const char *ifname, enum distribute_type type,
|
||||||
const char *plist_name)
|
const char *plist_name)
|
||||||
{
|
{
|
||||||
|
@ -249,8 +247,6 @@ distribute_list_prefix_set (const char *ifname, enum distribute_type type,
|
||||||
|
|
||||||
/* Apply this distribute-list to the interface. */
|
/* Apply this distribute-list to the interface. */
|
||||||
(*distribute_add_hook) (dist);
|
(*distribute_add_hook) (dist);
|
||||||
|
|
||||||
return dist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unset distribute-list. If matched distribute-list exist then
|
/* Unset distribute-list. If matched distribute-list exist then
|
||||||
|
@ -319,7 +315,7 @@ DEFUN (distribute_list,
|
||||||
DISTRIBUTE_IN : DISTRIBUTE_OUT;
|
DISTRIBUTE_IN : DISTRIBUTE_OUT;
|
||||||
|
|
||||||
/* Set appropriate function call */
|
/* Set appropriate function call */
|
||||||
int (*distfn)(const char *, enum distribute_type, const char *) = prefix ?
|
void (*distfn)(const char *, enum distribute_type, const char *) = prefix ?
|
||||||
&distribute_list_prefix_set : &distribute_list_set;
|
&distribute_list_prefix_set : &distribute_list_set;
|
||||||
|
|
||||||
/* if interface is present, get name */
|
/* if interface is present, get name */
|
||||||
|
|
8
lib/ns.c
8
lib/ns.c
|
@ -559,12 +559,12 @@ DEFUN (ns_netns,
|
||||||
{
|
{
|
||||||
ns_id_t ns_id = NS_DEFAULT;
|
ns_id_t ns_id = NS_DEFAULT;
|
||||||
struct ns *ns = NULL;
|
struct ns *ns = NULL;
|
||||||
char *pathname = ns_netns_pathname (vty, argv[1]);
|
char *pathname = ns_netns_pathname (vty, argv[3]->arg);
|
||||||
|
|
||||||
if (!pathname)
|
if (!pathname)
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
VTY_GET_INTEGER ("NS ID", ns_id, argv[0]);
|
VTY_GET_INTEGER ("NS ID", ns_id, argv[1]->arg);
|
||||||
ns = ns_get (ns_id);
|
ns = ns_get (ns_id);
|
||||||
|
|
||||||
if (ns->name && strcmp (ns->name, pathname) != 0)
|
if (ns->name && strcmp (ns->name, pathname) != 0)
|
||||||
|
@ -598,12 +598,12 @@ DEFUN (no_ns_netns,
|
||||||
{
|
{
|
||||||
ns_id_t ns_id = NS_DEFAULT;
|
ns_id_t ns_id = NS_DEFAULT;
|
||||||
struct ns *ns = NULL;
|
struct ns *ns = NULL;
|
||||||
char *pathname = ns_netns_pathname (vty, argv[1]);
|
char *pathname = ns_netns_pathname (vty, argv[4]->arg);
|
||||||
|
|
||||||
if (!pathname)
|
if (!pathname)
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
VTY_GET_INTEGER ("NS ID", ns_id, argv[0]);
|
VTY_GET_INTEGER ("NS ID", ns_id, argv[2]->arg);
|
||||||
ns = ns_lookup (ns_id);
|
ns = ns_lookup (ns_id);
|
||||||
|
|
||||||
if (!ns)
|
if (!ns)
|
||||||
|
|
Loading…
Reference in a new issue