Hello,
I was wondering if anyone could point me to the code that is
responsible to adding the default route for the 'rmnet0' gateway. I
have searched through the code very thoroughly, and found the
following:
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.
Any help in regard to finding where the 'rmnet0' gateway property is
set, or where the default route is established would be of great help.
Thanks in advance,
Brian