Skip to contentSkip to conversation

ublox: gprs-context: Fix router mode IP settings.

PATCH Applied [email protected] 2 participants 2 messages Apr 3, 2019 – Apr 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ublox: gprs-context: Fix router mode IP settings.

From: Richard Röjfors <[email protected]>

The ublox modems always run DHCP when in router mode. Unfortunately the code overwrote the IP settings with static IP settings while activating.

Now we respect the networking_mode regardless if we read settings during activation or read settings phase.

---
 drivers/ubloxmodem/gprs-context.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/ubloxmodem/gprs-context.c +8 -9
index 35abae02..489f31e8 100644
@@ -235,6 +235,14 @@ static void ublox_read_settings(struct ofono_gprs_context *gc)
 {
 	struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
 
+	if (gcd->networking_mode == NETWORKING_MODE_ROUTER) {
+		/* Use DHCP */
+		set_gprs_context_interface(gc);
+		ofono_gprs_context_set_ipv4_address(gc, NULL, 0);
+		CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+		return;
+	}
+
 	if (ublox_send_cgcontrdp(gc) < 0)
 		CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
 }
@@ -247,15 +255,6 @@ static void ublox_gprs_read_settings(struct ofono_gprs_context *gc,
 
 	DBG("cid %u", cid);
 
-	if (gcd->networking_mode == NETWORKING_MODE_ROUTER) {
-		/* 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;
Signature · 1 line
2.19.1
#1 lore raw

Hi Richard,

Quoted 6 lines · richard.rojfors(a)gmail.com

From: Richard Röjfors <[email protected]>

The ublox modems always run DHCP when in router mode. Unfortunately the code overwrote the IP settings with static IP settings while activating.

Quoted 7 lines

Now we respect the networking_mode regardless if we read settings during activation or read settings phase.

---
  drivers/ubloxmodem/gprs-context.c | 17 ++++++++---------
  1 file changed, 8 insertions(+), 9 deletions(-)

Applied, thanks.

Regards,
-Denis