2012年10月19日金曜日

Android 3G rmnet0 gateway

In the frameworks directory, ConnectivityService.java class makes a
call to addDefaultRoute() of NetworkStateTracker.java
This function calls NetworkUtils.setDefaultRoute under certain
conditions (interfaceName != null && defaultGateway != 0 &&
DefaultRouteSet == false). I find that this function is never called
because the conditions fails (this has been validated by adding log
messages and checking the output of 'logcat').

Also, I have found in hardware/ril/reference-ril/reference-ril.c that
a call is being made to system("netcfg rmnet0 dhcp"); However it does
not seem that this code path is executed either because the output of
'logcat' when running that command is very distinct, and cannot be
seen when simply deactivating and reactivating the interface.

Lastly I've validated that dhcpcd is not being run either in order to
set up the default route.

However, somewhere in the Android platform the default route for the
3G interface 'rmnet0' is being set. Also puzzling is that the property
"net.rmnet0.gw" is set with the correct gateway address, and I can't
seem to find this code either. I do see that in system/core/
libnetutils/ifc_utils.c, in the function ifc_configure there are
properties being set for "net.%s.dns1" where %s is the interface name,
but it does not seem that the gateway property is set here.

0 件のコメント:

コメントを投稿