samuraictf / gatekeeper

GATEKEEPER: Inline and on-target defense
119 stars 15 forks source link

fix UDP (local) forwarding #2

Closed zxkevn closed 9 years ago

zxkevn commented 9 years ago

As of the latest commit, tcp (local) to tcp/udp (remote) works fine. udp (local) to tcp/udp (remote) does not. Likely due to a lack of a connect() call on the local udp socket (the pumping logic in main() uses read() and write() on the sockets, and I think you have to connect() to an address with udp sockets for this to work correctly). If that's the case, we either connect() once receiving a datagram from somebody, or I'll have to change the logic after select() to something less protocol-agnostic.

zxkevn commented 9 years ago

Fixed by calling connect() on the local UDP socket. All protos <-> all protos seems to work now.