summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2018-09-24 05:42:01 -0400
committerJohn Lo <loj@cisco.com>2018-09-26 15:13:06 +0000
commite178b27f6e728c0654fc18e0d3ae6423e89fb1a9 (patch)
tree72aba272d89796c8f1a7bb73b16c384d5e583fa2 /src/vnet
parent37a3a2a08f72310a3f7e898a9b44af7751f2cc9c (diff)
Modify return values of L2 bridge API handlers
Change-Id: Ie6a6dde1fdc0e4fa8560682072a69876867a88d3 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/api_errno.h4
-rw-r--r--src/vnet/l2/l2_api.c20
2 files changed, 23 insertions, 1 deletions
diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h
index 05a4a45cd1f..fdafb7e6b54 100644
--- a/src/vnet/api_errno.h
+++ b/src/vnet/api_errno.h
@@ -143,7 +143,9 @@ _(BIER_BSL_UNSUP, -146, "BIER bit-string-length unsupported") \
_(INSTANCE_IN_USE, -147, "Instance in use") \
_(INVALID_SESSION_ID, -148, "session ID out of range") \
_(ACL_IN_USE_BY_LOOKUP_CONTEXT, -149, "ACL in use by a lookup context") \
-_(INVALID_VALUE_3, -150, "Invalid value #3")
+_(INVALID_VALUE_3, -150, "Invalid value #3") \
+_(NON_ETHERNET, -151, "Interface is not an Ethernet interface") \
+_(BD_ALREADY_HAS_BVI, -152, "Bridge domain already has a BVI interface")
typedef enum
{
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index 3f27feb638a..eb04459f234 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -688,6 +688,16 @@ static void
L2_BD_PORT_TYPE_NORMAL, 0, 0);
}
+ switch (rv)
+ {
+ case MODE_ERROR_ETH:
+ rv = VNET_API_ERROR_NON_ETHERNET;
+ break;
+ case MODE_ERROR_BVI_DEF:
+ rv = VNET_API_ERROR_BD_ALREADY_HAS_BVI;
+ break;
+ }
+
BAD_RX_SW_IF_INDEX_LABEL;
BAD_TX_SW_IF_INDEX_LABEL;
@@ -746,6 +756,16 @@ static void
rv = set_int_l2_mode (vm, vnm, MODE_L3, rx_sw_if_index, 0, pt, 0, 0);
}
+ switch (rv)
+ {
+ case MODE_ERROR_ETH:
+ rv = VNET_API_ERROR_NON_ETHERNET;
+ break;
+ case MODE_ERROR_BVI_DEF:
+ rv = VNET_API_ERROR_BD_ALREADY_HAS_BVI;
+ break;
+ }
+
BAD_RX_SW_IF_INDEX_LABEL;
BAD_BD_ID_LABEL;
out: