Android 3G rmnet0 gateway

2,372 views
Skip to first unread message

BTHD

unread,
Nov 2, 2010, 9:35:19 AM11/2/10
to android-platform
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

BTHD

unread,
Dec 14, 2010, 3:34:18 PM12/14/10
to android-platform
Anybody have a clue?

kyleo

unread,
Dec 26, 2010, 12:24:35 PM12/26/10
to android-platform
were you able to figure this out? we're trying to remove/add the
default gateway using the ifc_utils.c apis.

BTHD

unread,
Jan 6, 2011, 6:10:06 PM1/6/11
to android-platform
I have exhausted the possibilities in ifc_utils.c file including
commenting out the code for adding routes, no dice there. I did find a
workaround for this, but it requires a dirty hack. I'm still looking
for a clean solution.

I've done greps on the entire Android code base in order to find where
routes are added/removed, and also to find where the net.rmnet0.gw
property is set. I have the feeling if you can find where that
property is set you will be able to find where the default route is
set.

Please keep the thread alive if you find anything of interest.

Regards,
Brian

PINKERTON

unread,
Sep 5, 2014, 2:29:23 AM9/5/14
to android-...@googlegroups.com
Hi guys

I'd like to know if you've found anything on this topic. I'm wondering whether this parameter is setup by the mobile provider whenever the client connects to the network. I'd be curious as well about which IP addresses you see 

Thanks
Reply all
Reply to author
Forward
0 new messages