aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/lb/lb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c
index e1d4df55a3e..d5dc3054fb4 100644
--- a/src/plugins/lb/lb.c
+++ b/src/plugins/lb/lb.c
@@ -845,17 +845,22 @@ int lb_vip_add(lb_vip_add_args_t args, u32 *vip_index)
(type != LB_VIP_TYPE_IP4_GRE4) &&
(type != LB_VIP_TYPE_IP4_GRE6) &&
(type != LB_VIP_TYPE_IP4_L3DSR) &&
- (type != LB_VIP_TYPE_IP4_NAT4))
+ (type != LB_VIP_TYPE_IP4_NAT4)) {
+ lb_put_writer_lock();
return VNET_API_ERROR_INVALID_ADDRESS_FAMILY;
+ }
if ((!ip46_prefix_is_ip4(&(args.prefix), args.plen)) &&
(type != LB_VIP_TYPE_IP6_GRE4) &&
(type != LB_VIP_TYPE_IP6_GRE6) &&
- (type != LB_VIP_TYPE_IP6_NAT6))
+ (type != LB_VIP_TYPE_IP6_NAT6)) {
+ lb_put_writer_lock();
return VNET_API_ERROR_INVALID_ADDRESS_FAMILY;
+ }
if ((type == LB_VIP_TYPE_IP4_L3DSR) && (args.encap_args.dscp >= 64 ) )
{
+ lb_put_writer_lock();
return VNET_API_ERROR_VALUE_EXIST;
}