代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 7a03877d6838498d82f0e506e02d4507efd047ac Mon Sep 17 00:00:00 2001
From: jiangheng12 <jiangheng14@huawei.com>
Date: Wed, 22 Feb 2023 21:38:32 +0800
Subject: [PATCH] adapt unsupport sock optname
---
src/lstack/api/lstack_wrap.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index d976f74..77d2442 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -19,11 +19,11 @@
#include <sys/socket.h>
#include <stdarg.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <sys/epoll.h>
#include <unistd.h>
#include <lwip/posix_api.h>
-#include <lwip/api.h>
#include <lwip/lwipsock.h>
#include "posix/lstack_epoll.h"
@@ -273,9 +273,21 @@ static inline int32_t do_getsockname(int32_t s, struct sockaddr *name, socklen_t
return posix_api->getsockname_fn(s, name, namelen);
}
+static bool unsupport_optname(int32_t optname)
+{
+ if (optname == SO_BROADCAST ||
+ optname == SO_PROTOCOL ||
+ optname == TCP_QUICKACK ||
+ optname == SO_SNDTIMEO ||
+ optname == SO_RCVTIMEO) {
+ return true;
+ }
+ return false;
+}
+
static inline int32_t do_getsockopt(int32_t s, int32_t level, int32_t optname, void *optval, socklen_t *optlen)
{
- if (select_path(s) == PATH_LWIP) {
+ if (select_path(s) == PATH_LWIP && !unsupport_optname(optname)) {
return rpc_call_getsockopt(s, level, optname, optval, optlen);
}
@@ -284,7 +296,7 @@ static inline int32_t do_getsockopt(int32_t s, int32_t level, int32_t optname, v
static inline int32_t do_setsockopt(int32_t s, int32_t level, int32_t optname, const void *optval, socklen_t optlen)
{
- if (select_path(s) == PATH_KERNEL) {
+ if (select_path(s) == PATH_KERNEL || unsupport_optname(optname)) {
return posix_api->setsockopt_fn(s, level, optname, optval, optlen);
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。