bearer-qmi: cleanup indication handlers on network-initiated disconnects

Otherwise, they'll end up queueing up and each time we get a new
indication the signal will get called multiple times:

    [/dev/cdc-wdm0] received message...
    <<<<<< RAW:
    <<<<<<   length = 20
    <<<<<<   data   = 01:13:00:80:01:09:04:00:00:01:00:07:00:20:04:00:05:00:00:00
    [/dev/cdc-wdm0] received generic indication (translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 19
    <<<<<<   flags   = 0x80
    <<<<<<   service = "wds"
    <<<<<<   client  = 9
    <<<<<< QMI:
    <<<<<<   flags       = "indication"
    <<<<<<   transaction = 0
    <<<<<<   tlv_length  = 7
    <<<<<<   message     = "Event Report" (0x0001)
    <<<<<< TLV:
    <<<<<<   type       = "Preferred Data System" (0x20)
    <<<<<<   length     = 4
    <<<<<<   value      = 05:00:00:00
    <<<<<<   translated = lte
    <debug> [1504578559.592891] Got QMI WDS event report
    <debug> [1504578559.598212] Got QMI WDS event report
    <debug> [1504578559.601694] Got QMI WDS event report
This commit is contained in:
Aleksander Morgado
2017-09-15 11:07:58 -07:00
parent 2e792db2f2
commit 2ed9706148

View File

@@ -1584,11 +1584,33 @@ reset_bearer_connection (MMBearerQmi *self,
gboolean reset_ipv6)
{
if (reset_ipv4) {
if (self->priv->client_ipv4) {
if (self->priv->packet_service_status_ipv4_indication_id)
common_setup_cleanup_packet_service_status_unsolicited_events (self,
self->priv->client_ipv4,
FALSE,
&self->priv->packet_service_status_ipv4_indication_id);
if (self->priv->event_report_ipv4_indication_id)
cleanup_event_report_unsolicited_events (self,
self->priv->client_ipv4,
&self->priv->event_report_ipv4_indication_id);
}
self->priv->packet_data_handle_ipv4 = 0;
g_clear_object (&self->priv->client_ipv4);
}
if (reset_ipv6) {
if (self->priv->client_ipv6) {
if (self->priv->packet_service_status_ipv6_indication_id)
common_setup_cleanup_packet_service_status_unsolicited_events (self,
self->priv->client_ipv6,
FALSE,
&self->priv->packet_service_status_ipv6_indication_id);
if (self->priv->event_report_ipv6_indication_id)
cleanup_event_report_unsolicited_events (self,
self->priv->client_ipv6,
&self->priv->event_report_ipv6_indication_id);
}
self->priv->packet_data_handle_ipv6 = 0;
g_clear_object (&self->priv->client_ipv6);
}