summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index a439d2550a1..cc4464b162e 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3637,16 +3637,18 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
break;
case VPPCOM_ATTR_GET_DOMAIN:
- if (buffer && buflen && (*buflen >= sizeof (int)))
+ if (!(buffer && buflen && (*buflen >= sizeof (int))))
{
- if (session->transport.is_ip4)
- *(int *) buffer = AF_INET;
- else
- *(int *) buffer = AF_INET6;
- *buflen = sizeof (int);
+ rv = VPPCOM_EINVAL;
+ break;
}
+
+ if (session->transport.is_ip4)
+ *(int *) buffer = AF_INET;
else
- rv = VPPCOM_EINVAL;
+ *(int *) buffer = AF_INET6;
+ *buflen = sizeof (int);
+
VDBG (2, "VPPCOM_ATTR_GET_DOMAIN: %d, buflen %u", *(int *) buffer,
*buflen);
break;