jedisct1 / dsvpn

A Dead Simple VPN.
MIT License
5.17k stars 395 forks source link

Fix some casting, correct /32 for external IP on Mac #45

Closed layertwo closed 5 years ago

layertwo commented 5 years ago

Was trying out importing into Xcode on Mac, and had a few items it suggested to fix (int for ssize_t casting).

I was also getting interrupted system calls from execvp when running in the Xcode debugger. Solution was to change the waitpid options.

Lastly, there was a missing /32 netmask for the external IP when creating routing on Mac.

jedisct1 commented 5 years ago

Thanks!

Can you clarify why the /32 netmask (which creates a network route instead of a host route) is needed?

jedisct1 commented 5 years ago

For the very unlikely case where the server IP would be provided as a prefix, we'd better add the -host option than add a /32 network mask.

layertwo commented 5 years ago

Re: /32, now that I'm looking at the routing table more closely, it seems there's a bug in the tool iproute2mac which doesn't show the route unless I apply the /32. Running netstat -rn shows the route is applied correctly without my change. Should probably back that out then.

jedisct1 commented 5 years ago

Thanks!