basil00 / TorWall

Tallow - Transparent Tor for Windows
http://reqrypt.org/tallow.html
GNU General Public License v3.0
507 stars 121 forks source link

about tor handle_syn() #22

Closed Bo3o2S closed 5 years ago

Bo3o2S commented 5 years ago

first, thank you for make good program for everyone.

now a day, i tried to make program with WinDivert, which is checking target program name and check CONNECT state. and if WinDIvert get CONNECT event From SOCKET layer, list up 5-tuple to whitelist.

in other side, check NETWORK layer and if get whitelist, put some day in packet's payload(after IP header)

but, i just saw you said in about race codition about SOCKET CONNECT and NETWORK Sync packet. so i pended sync packet in NETWORK layer, using source in TorWall(handle_sync())

but it seem not working fine, In NETWORK layer packet pended. but always connect status is STATUS_NOT_CONNECTED,

what can i do if i want to solve race condition? expecially, in TorWall handle_sync()(from whitelist_worker thread). sync packet i always null, so "unlock(conns_lock)". and it's not working fine.

i think i confused about TorWall, can you give me some information about this?

basil00 commented 5 years ago

Are you saying that the current code is broken, or are you trying to adapt the current code for some other purpose?

The handling of the race is simple: the SYN is handled by either the NETWORK or SOCKET thread, depending on which event is seen last. If the SYN packet is NULL, then it just means the CONNECT event was received first.

basil00 commented 5 years ago

Close this.