jackpal / gateway

A golang library for discovering the address of a LAN gateway.
BSD 3-Clause "New" or "Revised" License
227 stars 69 forks source link

gateway will also have mask as 0 #33

Closed shrinidhi111 closed 1 year ago

shrinidhi111 commented 2 years ago

I was running a VPN connection with 0.0.0.0/2 as one of the subnets.

Since the linux logic checks for gateway IP for 0, it wrongly assumed VPN Gateway IP as the default one while it is not.

I was able to fix it by checking for both gateway + mask