ipt2socks:bump to 1.1.3

This commit is contained in:
coolsnowwolf 2020-06-17 11:36:13 +08:00 committed by CN_SZTL
parent d51a84ef90
commit 41b2e5ad04
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 3 additions and 52 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ipt2socks
PKG_VERSION:=1.1.2
PKG_VERSION:=1.1.3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/ipt2socks.git
PKG_SOURCE_VERSION:=cfbc2189356aba7fcafb0bc961a95419f313d8a7
PKG_SOURCE_VERSION:=384dab4bae5ed9402e07ec1950e502c05812bc26
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
@ -36,4 +36,4 @@ define Package/ipt2socks/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipt2socks $(1)/usr/bin
endef
$(eval $(call BuildPackage,ipt2socks))
$(eval $(call BuildPackage,ipt2socks))

View File

@ -1,49 +0,0 @@
--- a/ipt2socks.c
+++ b/ipt2socks.c
@@ -28,6 +28,36 @@
#define IPT2SOCKS_VERSION "ipt2socks v1.1.2 <https://github.com/zfl9/ipt2socks>"
+#ifdef __MUSL__
+#include <unistd.h>
+#include <sys/syscall.h>
+
+ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len, unsigned int __flags) {
+#ifdef __NR_splice
+ return syscall(__NR_splice, __fdin, __offin, __fdout, __offout, __len, __flags);
+#else
+ (void)__fdin;
+ (void)__offin;
+ (void)__fdout;
+ (void)__offout;
+ (void)__len;
+ (void)__flags;
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
+#undef SPLICE_F_MOVE
+#undef SPLICE_F_NONBLOCK
+#undef SPLICE_F_MORE
+
+#define SPLICE_F_MOVE 1
+#define SPLICE_F_NONBLOCK 2
+#define SPLICE_F_MORE 4
+
+#endif /* __MUSL__ */
+
enum {
OPT_ENABLE_TCP = 0x01 << 0, // enable tcp proxy
OPT_ENABLE_UDP = 0x01 << 1, // enable udp proxy
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -std=c99 -Wall -Wextra -O2 -pthread
+CFLAGS = -std=c99 -Wall -Wextra -O2 -pthread -D __MUSL__
LIBS = -lm
SRCS = ipt2socks.c logutils.c lrucache.c netutils.c protocol.c
OBJS = $(SRCS:.c=.o)