broadband-modem-qmi: fix dhcp/static IP setting when kernel data format updated

When the logic decided that we had to update the kernel data format to match the
one configured in the WWAN network interface, we were not flagging the port LLP
with the correct value, what resulted in NetworkManager trying to use dhclient
on the raw-ip interface:

    dhclient[3257]: Unsupported device type 65534 for "wwan1"
    dhclient[3257]:
    dhclient[3257]: If you think you have received this message due to a bug rather
    dhclient[3257]: than a configuration issue please read the section on submitting
    dhclient[3257]: bugs on either our web page at www.isc.org or in the README file
    dhclient[3257]: before submitting a bug.  These pages explain the proper
    dhclient[3257]: process and the information we find helpful for debugging..
    dhclient[3257]:
    dhclient[3257]: exiting.

Fix the internal LLP flag, so that Static IP addressing is requested for all raw-ip
based interfaces.
This commit is contained in:
Aleksander Morgado
2016-07-14 14:59:17 +02:00
parent 48f0210739
commit 46b17908ce
2 changed files with 6 additions and 4 deletions

View File

@@ -329,7 +329,7 @@ modem_create_bearer (MMIfaceModem *self,
modem_create_bearer);
/* We just create a MMBearerQmi */
mm_dbg ("Creating QMI bearer in QMI modem");
mm_dbg ("Creating QMI bearer (%s) in QMI modem", force_dhcp ? "DHCP" : "Static IP");
bearer = mm_bearer_qmi_new (MM_BROADBAND_MODEM_QMI (self), properties, force_dhcp);
g_simple_async_result_set_op_res_gpointer (result, bearer, g_object_unref);
g_simple_async_result_complete_in_idle (result);

View File

@@ -453,11 +453,13 @@ port_open_context_step (PortOpenContext *ctx)
case PORT_OPEN_STEP_SET_KERNEL_DATA_FORMAT:
/* Update the data format to be expected by the kernel */
mm_dbg ("Updating kernel data format: %s", qmi_wda_link_layer_protocol_get_string (ctx->llp));
if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_802_3)
if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_802_3) {
ctx->kernel_data_format = QMI_DEVICE_EXPECTED_DATA_FORMAT_802_3;
else if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP)
ctx->self->priv->llp_is_raw_ip = FALSE;
} else if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP) {
ctx->kernel_data_format = QMI_DEVICE_EXPECTED_DATA_FORMAT_RAW_IP;
else
ctx->self->priv->llp_is_raw_ip = TRUE;
} else
g_assert_not_reached ();
/* Regardless of the output, we're done after this action */