summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-03-07 15:37:18 -0500
committerDave Barach <dave@barachs.net>2016-03-07 15:37:31 -0500
commitd255a2782a6d1634c5f1da9931b7c0c44ae2345b (patch)
treefea04f8f836eec6f9490a5d124fb626d967ccc85 /vnet
parent00bbf276be22fa0458366d4dd3f4daf4e55d13e7 (diff)
Packet filter control-plane API bugfix
Don't complain about unknown fib-id's unless actually trying to use the indicated per-address-family fib. Change-Id: Ie8c28dbf7dac9c38193a02ff15a8529d0f90d99a Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/cop/cop.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/vnet/vnet/cop/cop.c b/vnet/vnet/cop/cop.c
index 3dbbbd54..a352b371 100644
--- a/vnet/vnet/cop/cop.c
+++ b/vnet/vnet/cop/cop.c
@@ -257,9 +257,14 @@ int cop_whitelist_enable_disable (cop_whitelist_enable_disable_args_t *a)
/* configured opaque data must match, or no supper */
p = hash_get (im4->fib_index_by_table_id, a->fib_id);
if (p)
- fib_index = p[0];
+ fib_index = p[0];
else
- return VNET_API_ERROR_NO_SUCH_FIB;
+ {
+ if (is_add)
+ return VNET_API_ERROR_NO_SUCH_FIB;
+ else
+ continue;
+ }
break;
case VNET_COP_IP6:
@@ -267,9 +272,14 @@ int cop_whitelist_enable_disable (cop_whitelist_enable_disable_args_t *a)
next_to_add_del = IP6_RX_COP_WHITELIST;
p = hash_get (im6->fib_index_by_table_id, a->fib_id);
if (p)
- fib_index = p[0];
+ fib_index = p[0];
else
- return VNET_API_ERROR_NO_SUCH_FIB;
+ {
+ if (is_add)
+ return VNET_API_ERROR_NO_SUCH_FIB;
+ else
+ continue;
+ }
break;
case VNET_COP_DEFAULT: