zfl9 / ipt2socks

将 iptables/nftables 传入的透明代理流量转为 socks5 流量的实用工具
GNU Affero General Public License v3.0
447 stars 103 forks source link

编译环境有问题 #41

Closed ghost closed 3 years ago

ghost commented 3 years ago

比如 naiveproxy的socks5, (https://github.com/klzgrad/naiveproxy

clash,dns2socks这些就能与naiveproxy凑合着用

贴一下错误信息

2021-10-27 14:46:40 INF: [main] server address: 127.0.0.1#1080 2021-10-27 14:46:40 INF: [main] listen address: 0.0.0.0#12345 2021-10-27 14:46:40 INF: [main] listen address: ::#12345 2021-10-27 14:46:40 INF: [main] udp cache maximum size: 256 2021-10-27 14:46:40 INF: [main] udp socket idle timeout: 60 2021-10-27 14:46:40 INF: [main] number of worker threads: 1 2021-10-27 14:46:40 INF: [main] enable tcp transparent proxy 2021-10-27 14:46:40 INF: [main] enable udp transparent proxy 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:49:30 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:50:56 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer 2021-10-27 14:50:56 ERR: [tcp_stream_payload_forward_cb] recv from client stream: Connection reset by peer ./ipt2socks: libev/ev_poll.c: 113: poll_poll: Assertion `("libev: poll returned illegal result, broken BSD kernel?", p < ((loop)->polls) + ((loop)->pollcnt))' failed. Aborted

zfl9 commented 3 years ago

libev的问题

zfl9 commented 3 years ago

为什么你用的是poll后端?什么系统?

ghost commented 3 years ago

用的路由器上linux系统,uname -a

Linux 4.1.51 #2 SMP PREEMPT Fri Aug 6 17:57:11 EDT 2021 aarch64

ghost commented 3 years ago

有什么建议吗? 用新版的libev编译?

zfl9 commented 3 years ago

内核有问题吧?为什么没有选择epoll呢。我看你这个是linux内核呀,应该是会选择epoll的,不应该选择poll

zfl9 commented 3 years ago

我看下libev文档先

zfl9 commented 3 years ago

https://github.com/zfl9/ipt2socks/blob/c1413335f0b5f15241d7072204902778d122a578/ipt2socks.c#L394

把这行的 ev_loop_new(0) 改为 ev_loop_new(EVBACKEND_EPOLL | EVFLAG_NOENV)。然后重新编译再试下。

ghost commented 3 years ago

你的代码没问题,是我的工具链有问题,我换了工具链,就不漰溃了,多谢帮忙