Skip to content
Permalink
Browse files

staticd: remove usage of vrf_is_backend_netns in staticd

this function had to be used only inside zebra ( this was written in the
header vrf.h). To keep the functionality, a more generic API is used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information...
pguibert6WIND committed Aug 22, 2018
1 parent 3d4c0b4 commit f69f6f56f58bbbfd069fa8dd108e04aec6caf623
Showing with 12 additions and 12 deletions.
  1. +12 −12 staticd/static_vty.c
@@ -766,7 +766,7 @@ DEFPY(ip_route_blackhole,
"Table to configure\n"
"The table number to configure\n")
{
if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -805,7 +805,7 @@ DEFPY(ip_route_blackhole_vrf,
VTY_DECLVAR_CONTEXT(vrf, vrf);
struct static_vrf *svrf = vrf->info;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -868,7 +868,7 @@ DEFPY(ip_route_address_interface,
return CMD_WARNING_CONFIG_FAILED;
}

if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -924,7 +924,7 @@ DEFPY(ip_route_address_interface_vrf,
struct static_vrf *svrf = vrf->info;
struct static_vrf *nh_svrf;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -984,7 +984,7 @@ DEFPY(ip_route,
struct static_vrf *nh_svrf;
const char *flag = NULL;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1049,7 +1049,7 @@ DEFPY(ip_route_vrf,
struct static_vrf *nh_svrf;
const char *flag = NULL;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1104,7 +1104,7 @@ DEFPY(ipv6_route_blackhole,
"Table to configure\n"
"The table number to configure\n")
{
if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1144,7 +1144,7 @@ DEFPY(ipv6_route_blackhole_vrf,
VTY_DECLVAR_CONTEXT(vrf, vrf);
struct static_vrf *svrf = vrf->info;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1195,7 +1195,7 @@ DEFPY(ipv6_route_address_interface,
struct static_vrf *svrf;
struct static_vrf *nh_svrf;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1255,7 +1255,7 @@ DEFPY(ipv6_route_address_interface_vrf,
struct static_vrf *svrf = vrf->info;
struct static_vrf *nh_svrf;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1309,7 +1309,7 @@ DEFPY(ipv6_route,
struct static_vrf *svrf;
struct static_vrf *nh_svrf;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && vrf && !vrf_is_mapped_on_netns(vrf_lookup_by_name(vrf))) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1368,7 +1368,7 @@ DEFPY(ipv6_route_vrf,
struct static_vrf *svrf = vrf->info;
struct static_vrf *nh_svrf;

if (table_str && !vrf_is_backend_netns()) {
if (table_str && !vrf_is_mapped_on_netns(vrf)) {
vty_out(vty,
"%% table param only available when running on netns-based vrfs\n");
return CMD_WARNING_CONFIG_FAILED;

0 comments on commit f69f6f5

Please sign in to comment.
You can’t perform that action at this time.