i trying use vpnservice api capture packets (on android 4.4). i've been following example at:
http://www.thegeekstuff.com/2014/06/android-vpn-service/
i establish vpn connection using builder, configured using following code (which borrowed toyvpn sample, i'm sure many of recognize):
// configure builder while parsing parameters. builder builder = new builder(); builder.setmtu(1500); builder.addaddress("192.168.0.1", 24); builder.addroute("0.0.0.0", 0); try { minterface.close(); } catch (exception e) { // ignore } minterface = builder.establish();
the general concept vpnservice, able outbound packets , log them. open socket original destination , forward packets. when response comes, via socket opened.
so question is, happens when ip address sends me packet before i've opened socket address? i'm guessing either bypasses vpn , arrives normal, or dropped entirely (probably former?). insight appreciated.
when addroute("0.0.0.0",0); packets routed tun interface. upto whether want forward them original destination or not.
so answer question still packets application trying connect server, , whether allow not.
Comments
Post a Comment