summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorwanghanlin <wanghanlin@corp.netease.com>2021-02-22 10:38:36 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-02-22 22:17:22 +0000
commit0674f85c803b59ada3643bfaeba1b321abeb5d6a (patch)
tree752a60c978b64e31647594b5c8d3f13090dc4129 /src/vcl/vppcom.c
parentf86b967c368ed982ca439a96bab4604025345c00 (diff)
vcl: support sockopt of SO_REUSEPORT and SO_DOMAIN
Type: fix Signed-off-by: wanghanlin <wanghanlin@corp.netease.com> Change-Id: I800cfffb07bf7d4c4d1454b73febdba03f7d6b75
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index b576e1a8dd3..a439d2550a1 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3636,6 +3636,21 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
*buflen = sizeof (u32);
break;
+ case VPPCOM_ATTR_GET_DOMAIN:
+ if (buffer && buflen && (*buflen >= sizeof (int)))
+ {
+ if (session->transport.is_ip4)
+ *(int *) buffer = AF_INET;
+ else
+ *(int *) buffer = AF_INET6;
+ *buflen = sizeof (int);
+ }
+ else
+ rv = VPPCOM_EINVAL;
+ VDBG (2, "VPPCOM_ATTR_GET_DOMAIN: %d, buflen %u", *(int *) buffer,
+ *buflen);
+ break;
+
default:
rv = VPPCOM_EINVAL;
break;