ublox: TOBY L4 supports only router mode

The TOBY L4 supports only "router mode" where the modem presents a
network interface that one can run a DHCP client against.  Behind this
interface, the modem takes care of routing packets via NAT by:

i)  selecting the relevant context based on destination IP
ii) using the first activated context as the default route

In order to have the connection manager, thus, do the right thing, the
context only needs to report itself as being active and with the IP
settings set to method "dhcp".  There's no need for the connection manager
to know details like what IP address the context was assigned.

Tested with connman that does the right thing when it finds an active
"dhcp" context.
This commit is contained in:
Jonas Bonn 2019-03-14 23:28:41 +01:00 committed by Denis Kenzior
parent 5a6de99737
commit efe1306ec2
1 changed files with 9 additions and 0 deletions

View File

@ -240,6 +240,15 @@ static void ublox_gprs_read_settings(struct ofono_gprs_context *gc,
DBG("cid %u", cid);
if (ublox_is_toby_l4(gcd->model)) {
/* Use DHCP */
gcd->active_context = cid;
set_gprs_context_interface(gc);
ofono_gprs_context_set_ipv4_address(gc, NULL, 0);
CALLBACK_WITH_SUCCESS(cb, data);
return;
}
gcd->active_context = cid;
gcd->cb = cb;
gcd->cb_data = data;