jackpal / gateway

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

add _android #13

Closed axet closed 8 years ago

axet commented 8 years ago

Not every android has proper route table. But for some it works. Also I add ping discover. Not sure if it is good idea :) Not every routers ppp connections respond to ping -t 0.

jackpal commented 8 years ago

Is there an Android device you know of, that doesn't have route or ip, but does have ping?

Also it looks like the commands to ping might not be correct -- see my comment in your CL.

axet commented 8 years ago

I'm not yet happy about a solution. On my android phone it works only when I use wifi connection and it stuck for a 1 second with no result while I'm on mobile data.

And yes I did test it booth -t 1 && -t 0 works on my phone and route table are empty (may be all devices with android 6.0 have no correct route table). My device Nexus 5, it have route table, but it missing default route.

Google documentation says we should use RouteInfo... lets me dig for a day...

axet commented 8 years ago

Seems not worth it. I can't ensure gateway have been detected with any option:

And I do not like ping timeout issue. So. I'll close pull request, and keep changes in my tree. Feel free to merge manually.

jackpal commented 7 years ago

Thanks for trying!