Comments (13)
I will do this myself
from badvpn.
Sorry I don't maintain this code regularly anymore. Note that the vanilla lwip is probably not okay, tun2socks needs changes to support binding to all addresses and all ports, in my adaptation that is tcp_bind_to_netif()
. Probably the fork by VirtualBox has equivalent changes but I don't know how up to date it is.
from badvpn.
Thanks for the information. I found the diff based on lwip-base-version file: https://gist.github.com/wongsyrone/2a2c134e8f927364e598d2a6e706f4a8
from badvpn.
Hi, I modified twip latest git HEAD to make it work on tun2socks.
Here goes the commits:
simple copy and paste and updated lwip-base-version to give clear instruction which point we are located
wongsyrone@0c08474
update custom folder and drop outdated defs
wongsyrone@2422fc5
the most important changes to lwip to let us be able to bind to all addresses and all ports
wongsyrone@8a77977
finally, update tun2socks source code to make it working, please ignore some out-of-tree android changes
wongsyrone@3d2e394
another boring change to keep updated, especially for ip addr macro change, since we only need raw api
wongsyrone@3ce4233
Other files are not modified, twip sources list can be obtained via newly added src/Filelists.mk
from badvpn.
There is a new opt called LWIP_SINGLE_NETIF, we can define this to reduce code footprint further.
tun2socks only use one netif named "ho0"; this option might be designed for tun2socks. :)
from badvpn.
I tried to incorporate these changes but upon testing with Valgrind I'm seeing what might be memory leaks (TCP PCBs seems to be leaking, Valgrind claims "definitely lost"). I will investigate and push once that is resolved.
from badvpn.
TCP PCBs seems to be leaking
might in tcp_in.c, but not sure
from badvpn.
I analyzed this further and there is indeed a real leak. I filed a but report at lwIP: https://savannah.nongnu.org/bugs/index.php?52112
Technically it seems possible to work around it by avoiding calling tcp_close from lwIP callbacks but I hope it is fixed soon so I won't have to do that.
from badvpn.
By the way, I am currently developing my own TCP/IP stack and at some point I will just replace lwIP with that for tun2socks - hopefully that will be the end of having to deal with lwIP bugs and updates.
from badvpn.
it seems that leaking issue doesn't exist. Developing your own won't be a good idea, there is fewer people working on bugs and security flaws.
from badvpn.
The leak definitely exists in the code you have, if you don't see it you have not tested enough. I found out it was caused by tun2socks code too often returning ERR_ABRT from callbacks. This was a workaround for an old lwIP bug which has since been fixed and the workaround was now causing the leak. I have fixed the issue and pushed the updated code to this repository. You probably want to sync at least the tun2socks.c changes.
Developing your own won't be a good idea, there is fewer people working on bugs and security flaws.
My thing (which is already very functional) likely has orders of magnitude less bugs than lwIP, so I'll just keep working on it :) It doesn't yet have the "bind to all" function that is needed for tun2socks but that can be added easily.
from badvpn.
Well. I'm not able to write my own TCP/IP stack. As long as you keep maintaining this, there is no issue at all, but one day you stop supporting, only you can understand the whole thing.
from badvpn.
This was a workaround for an old lwIP bug
I have little knowledge on tun2socks, I even don't know it was a workaround. My intention is just to make it work not bug-free since you said "Sorry I don't maintain this code regularly anymore."
I think it worth noting about the mechanism tun2socks uses, such as binding to all addresses and ports, etc. In this way, others can keep going if one day you decide to drop it. It is just a suggestion.
from badvpn.
Related Issues (20)
- confused me:why use an empty job for sync in listener_accept_func HOT 4
- socks5 udp doesn't work with IPv6 HOT 1
- why not using boost::asio
- 请问tun2socks透明代理udp该怎么做? HOT 2
- Forks
- Any limitations on Raspberry Pi? HOT 5
- Linux Router
- move_first_timers crash HOT 1
- BadVPN not Working Properly
- ERROR(udpgw): BConnection_Init failed HOT 8
- BADVPN ERROR
- out of UDP buffer
- Virtual netword adapter tap 9 via tun2socks. Need instruction HOT 4
- tun2socks и proxy ipv6
- Assertion failed in BReactor_badvpn.c
- How does the UdpGw daemon work? HOT 2
- tun2socks not support half-closing
- tun2socks on freebsd
- nss/ssl.h not found HOT 1
- 能否在Wiki中写一下tun2socks组件转发的UDP包结构? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from badvpn.