Skip to content

Commit

Permalink
splice undeclared patch (need test)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfl9 committed May 30, 2020
1 parent cfbc218 commit 61b5229
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ipt2socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@

#define IPT2SOCKS_VERSION "ipt2socks v1.1.2 <https://github.com/zfl9/ipt2socks>"

#ifndef SPLICE_F_MOVE
#include <sys/syscall.h>

#undef SPLICE_F_MOVE
#define SPLICE_F_MOVE 1

#undef SPLICE_F_NONBLOCK
#define SPLICE_F_NONBLOCK 2

ssize_t splice(int fdin, __off64_t *offin, int fdout, __off64_t *offout, size_t len, unsigned int flags) {
return syscall(__NR_splice, fdin, offin, fdout, offout, len, flags);
}
#endif

enum {
OPT_ENABLE_TCP = 0x01 << 0, // enable tcp proxy
OPT_ENABLE_UDP = 0x01 << 1, // enable udp proxy
Expand Down

0 comments on commit 61b5229

Please sign in to comment.