[PATCH] bearer-mbim: fix disconnect error handling case split

Prathmesh Prabhu Chromium pprabhu at chromium.org
Thu Jun 19 11:23:18 PDT 2014


I screwed this up during an internal review :|

Here's a trace of an artificial failed disconnect created by reducing the
disconnect timeout to 1 s:

2014-06-19T19:12:19.204456+01:00 localhost ModemManager[15402]: <debug>
Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
2014-06-19T19:12:19.204535+01:00 localhost ModemManager[15402]: <info>
 Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected ->
disconnecting)
2014-06-19T19:12:19.206328+01:00 localhost ModemManager[15402]: <debug>
Launching disconnection on data port (net/wwan0)
2014-06-19T19:12:19.206724+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Sent message...#012<<<<<< RAW:#012<<<<<<   length =
108#012<<<<<<   data   =
03:00:00:00:6C:00:00:00:1C:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0C:00:00:00:01:00:00:00:3C:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:7E:5E:2A:7E:4E:6F:72:72:73:6B:65:6E:7E:5E:2A:7E
2014-06-19T19:12:19.206986+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Sent message (translated)...#012<<<<<< Header:#012<<<<<<
length      = 108#012<<<<<<   type        = command (0x00000003)#012<<<<<<
  transaction = 28#012<<<<<< Fragment header:#012<<<<<<   total   =
1#012<<<<<<   current = 0#012<<<<<< Contents:#012<<<<<<   service =
'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)#012<<<<<<   cid
= 'connect' (0x0000000c)#012<<<<<<   type    = 'set' (0x00000001)
2014-06-19T19:12:20.208974+01:00 localhost ModemManager[15402]: <debug>
Couldn't disconnect bearer '/org/freedesktop/ModemManager1/Bearer/0'
2014-06-19T19:12:20.209060+01:00 localhost ModemManager[15402]: <info>
 Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disconnecting
-> connected)
2014-06-19T19:12:23.590720+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Received message...#012>>>>>> RAW:#012>>>>>>   length =
84#012>>>>>>   data   =
03:00:00:80:54:00:00:00:1C:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0C:00:00:00:00:00:00:00:24:00:00:00:00:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:7E:5E:2A:7E:4E:6F:72:72:73:6B:65:6E:7E:5E:2A:7E:00:00:00:00
2014-06-19T19:12:23.590821+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] No transaction matched in received message
2014-06-19T19:12:23.591792+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Received unexpected message (translated)...#012>>>>>>
Header:#012>>>>>>   length      = 84#012>>>>>>   type        = command-done
(0x80000003)#012>>>>>>   transaction = 28#012>>>>>> Fragment
header:#012>>>>>>   total   = 1#012>>>>>>   current = 0#012>>>>>>
Contents:#012>>>>>>   status error = 'None' (0x00000000)#012>>>>>>
service      = 'basic-connect'
(a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)#012>>>>>>   cid          = 'connect'
(0x0000000c)
2014-06-19T19:12:29.661668+01:00 localhost ModemManager[15402]: <debug>
Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
2014-06-19T19:12:29.661754+01:00 localhost ModemManager[15402]: <info>
 Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected ->
disconnecting)
2014-06-19T19:12:29.664905+01:00 localhost ModemManager[15402]: <debug>
Launching disconnection on data port (net/wwan0)
2014-06-19T19:12:29.665653+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Sent message...#012<<<<<< RAW:#012<<<<<<   length =
108#012<<<<<<   data   =
03:00:00:00:6C:00:00:00:1D:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0C:00:00:00:01:00:00:00:3C:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:7E:5E:2A:7E:4E:6F:72:72:73:6B:65:6E:7E:5E:2A:7E
2014-06-19T19:12:29.665724+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Sent message (translated)...#012<<<<<< Header:#012<<<<<<
length      = 108#012<<<<<<   type        = command (0x00000003)#012<<<<<<
  transaction = 29#012<<<<<< Fragment header:#012<<<<<<   total   =
1#012<<<<<<   current = 0#012<<<<<< Contents:#012<<<<<<   service =
'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)#012<<<<<<   cid
= 'connect' (0x0000000c)#012<<<<<<   type    = 'set' (0x00000001)
2014-06-19T19:12:29.667842+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Received message...#012>>>>>> RAW:#012>>>>>>   length =
84#012>>>>>>   data   =
03:00:00:80:54:00:00:00:1D:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0C:00:00:00:10:00:00:00:24:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
2014-06-19T19:12:29.667866+01:00 localhost ModemManager[15402]:
[/dev/cdc-wdm0] Received message (translated)...#012>>>>>>
Header:#012>>>>>>   length      = 84#012>>>>>>   type        = command-done
(0x80000003)#012>>>>>>   transaction = 29#012>>>>>> Fragment
header:#012>>>>>>   total   = 1#012>>>>>>   current = 0#012>>>>>>
Contents:#012>>>>>>   status error = 'ContextNotActivated'
(0x00000010)#012>>>>>>   service      = 'basic-connect'
(a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)#012>>>>>>   cid          = 'connect'
(0x0000000c)
2014-06-19T19:12:29.667907+01:00 localhost ModemManager[15402]: <debug>
Session ID '0' already disconnected.
2014-06-19T19:12:29.667954+01:00 localhost ModemManager[15402]: <debug>
(wwan0): port now disconnected
2014-06-19T19:12:29.668011+01:00 localhost ModemManager[15402]: <debug>
Disconnected bearer '/org/freedesktop/ModemManager1/Bearer/0'
2014-06-19T19:12:29.668075+01:00 localhost ModemManager[15402]: <info>
 Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disconnecting
-> registered)



On Thu, Jun 19, 2014 at 11:20 AM, <pprabhu at chromium.org> wrote:

> From: Prathmesh Prabhu <pprabhu at chromium.org>
>
> The first case, with no error, needs to check that there was no original
> error.
> Currently, if an error occurs and the resulting NwError is parsed
> correctly, the
> case split treats it as a no-error case.
> ---
>  src/mm-bearer-mbim.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
> index 55305bb..643964d 100644
> --- a/src/mm-bearer-mbim.c
> +++ b/src/mm-bearer-mbim.c
> @@ -980,7 +980,7 @@ disconnect_set_ready (MbimDevice *device,
>          }
>
>          /* Now handle different response / error cases */
> -        if (parsed_result) {
> +        if (result && parsed_result) {
>              mm_dbg ("Session ID '%u': %s",
>                      session_id,
>                      mbim_activation_state_get_string (activation_state));
> --
> 2.0.0.526.g5318336
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20140619/48e3f7f5/attachment-0001.html>


More information about the ModemManager-devel mailing list