[review] dcbw/ipv6-fixes: fix IPv6 support in core and plugins

Bjørn Mork bjorn at mork.no
Wed Jun 11 05:38:07 PDT 2014


Dan Williams <dcbw at redhat.com> writes:

> Please review and test!
>
> Big changes in this branch (which we can change if we want to!) are that
> by default, QMI, Ericsson/MBM, and Icera devices now read and send
> static IP configuration in-addition-to/instead of DHCP, if we have those
> details.  This is done for both IPv4 and IPv6.
>
> For QMI, static configuration is always used, because we can always read
> the IP addresses and DNS servers from the firmware.
>
> For MBM, if the firmware supports E2IPCFG we use that information,
> otherwise we fall back to DHCP/auto.

Seems to work as expected (based on what E2IPCFG reports) with an
Ericsson H5321gw being used as an NCM modem (i.e. an MBM type modem):


bjorn at nemi:~$ mmcli -m 2

/org/freedesktop/ModemManager1/Modem/2 (device id '626689e006b326bd909b7d6296cd291411b3100e')
  -------------------------
  Hardware |   manufacturer: 'Lenovo'
           |          model: 'H5321 gw'
           |       revision: 'R3C11'
           |      supported: 'gsm-umts'
           |        current: 'gsm-umts'
           |   equipment id: '359001044826845'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:1d.7/usb5/5-1'
           |        drivers: 'cdc_acm, cdc_wdm, cdc_ncm'
           |         plugin: 'Ericsson MBM'
           |   primary port: 'ttyACM3'
           |          ports: 'ttyACM3 (at), ttyACM4 (at), ttyACM1 (at), cdc-wdm1 (at), wwan1 (net), cdc-wdm2 (at)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'none'
           | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
           |          state: 'connected'
           |    power state: 'on'
           |    access tech: 'hspa'
           | signal quality: '60' (recent)
  -------------------------
  Modes    |      supported: 'allowed: any; preferred: none'
           |        current: 'allowed: any; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6'
  -------------------------
  3GPP     |           imei: '359001044826845'
           |  enabled locks: 'sim'
           |    operator id: '24201'
           |  operator name: 'TELENOR'
           |   subscription: 'unknown'
           |   registration: 'home'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/2'

  -------------------------
  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/1'

bjorn at nemi:~$ mmcli -b 1
Bearer '/org/freedesktop/ModemManager1/Bearer/1'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: 'wwan1'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'telenor.mobil'
                     |     roaming: 'allowed'
                     |     IP type: 'ipv6'
                     |        user: 'none'
                     |    password: 'none'
                     |      number: 'none'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'unknown'
  -------------------------
  IPv6 configuration |   method: 'dhcp'
                     |  address: 'fe80:0000:0000:0000:0000:0027:6391:db01'
                     |   prefix: '64'
                     |  gateway: 'unknown'
                     |      DNS: '2001:4600:0004:0fff:0000:0000:0000:0054', '2001:4600:0004:1fff:0000:0000:0000:0054'


But I still have no idea how to actually get the assigned global /64 out
of this modem...

IPv4 only works perfect:

bjorn at nemi:~$ mmcli -b 2
Bearer '/org/freedesktop/ModemManager1/Bearer/2'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: 'wwan1'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'telenor'
                     |     roaming: 'allowed'
                     |     IP type: 'ipv4'
                     |        user: 'none'
                     |    password: 'none'
                     |      number: 'none'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'static'
                     |  address: '77.17.207.83'
                     |   prefix: '28'
                     |  gateway: '77.17.207.82'
                     |      DNS: '193.213.112.4', '130.67.15.198'
  -------------------------
  IPv6 configuration |   method: 'unknown'


Huawei E392 is fine both with IPv6 and IPv4 (cannot test dualstack at
the moment, so these are separate connections):

bjorn at nemi:~$ mmcli -m 3

/org/freedesktop/ModemManager1/Modem/3 (device id 'd76c0b8fbe4574531610b729712e1ce358ed9fd5')
  -------------------------
  Hardware |   manufacturer: 'QUALCOMM INCORPORATED'
           |          model: '0'
           |       revision: 'M9200B-SCAQDBZD-3.0.350025T  1  [Aug 11 2011 02:00:00]'
           |      supported: 'gsm-umts
           |                  lte
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '860999000023707'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:1d.7/usb5/5-1'
           |        drivers: 'qmi_wwan, option1'
           |         plugin: 'Huawei'
           |   primary port: 'cdc-wdm1'
           |          ports: 'ttyUSB0 (at), ttyUSB1 (at), ttyUSB2 (qcdm), cdc-wdm1 (qmi), wwan1 (net)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'sim-pin2'
           | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
           |          state: 'connected'
           |    power state: 'on'
           |    access tech: 'lte'
           | signal quality: '62' (recent)
  -------------------------
  Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
           |        current: 'allowed: 2g, 3g, 4g; preferred: none'
  -------------------------
  Bands    |      supported: 'cdma-bc15-aws, dcs, egsm, pcs, g850, u2100, u1800, u900'
           |        current: 'cdma-bc15-aws, dcs, egsm, pcs, g850, u2100, u1800, u900'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '860999000023707'
           |  enabled locks: 'none'
           |    operator id: '24201'
           |  operator name: 'TELENOR'
           |   subscription: 'unknown'
           |   registration: 'home'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/3'

  -------------------------
  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/3'


bjorn at nemi:~$ mmcli -b 3
Bearer '/org/freedesktop/ModemManager1/Bearer/3'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: 'wwan1'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'telenor.mobil'
                     |     roaming: 'allowed'
                     |     IP type: 'ipv6'
                     |        user: 'none'
                     |    password: 'none'
                     |      number: 'none'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'unknown'
  -------------------------
  IPv6 configuration |   method: 'static'
                     |  address: '2a02:2121:1:88c1:387e:b85e:1e57:b716'
                     |   prefix: '64'
                     |  gateway: '2a02:2121:1:88c1:14d2:516d:1cb7:4482'
                     |      DNS: '2001:4600:4:fff::54', '2001:4600:4:1fff::54'
                     |      MTU: '1500'

bjorn at nemi:~$ mmcli -b 4
Bearer '/org/freedesktop/ModemManager1/Bearer/4'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: 'wwan1'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'telenor'
                     |     roaming: 'allowed'
                     |     IP type: 'ipv4'
                     |        user: 'none'
                     |    password: 'none'
                     |      number: 'none'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'static'
                     |  address: '46.156.85.242'
                     |   prefix: '30'
                     |  gateway: '46.156.85.241'
                     |      DNS: '193.213.112.4', '130.67.15.198'
                     |      MTU: '1500'
  -------------------------
  IPv6 configuration |   method: 'unknown'


But the Huawei E367 (used as a QMI modem) has a minor failure.  No IPv4
configuration is reported:

bjorn at nemi:~$ mmcli -m 4 

/org/freedesktop/ModemManager1/Modem/4 (device id '46a154e246b833ff018abaff065b2cfedd6ae101')
  -------------------------
  Hardware |   manufacturer: 'QUALCOMM INCORPORATED'
           |          model: '8'
           |       revision: '8200C-FACPACZQ-10388101  1  [Jan 10 2011 10:00:00]'
           |      supported: 'gsm-umts'
           |        current: 'gsm-umts'
           |   equipment id: '353613048805199'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:1d.7/usb5/5-1'
           |        drivers: 'qmi_wwan, option1'
           |         plugin: 'Huawei'
           |   primary port: 'cdc-wdm1'
           |          ports: 'ttyUSB0 (at), ttyUSB3 (at), ttyUSB4 (qcdm), wwan1 (net), cdc-wdm1 (qmi)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'sim-pin2'
           | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
           |          state: 'connected'
           |    power state: 'on'
           |    access tech: 'umts'
           | signal quality: '97' (recent)
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g'
           |        current: 'allowed: any; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '353613048805199'
           |  enabled locks: 'none'
           |    operator id: '24201'
           |  operator name: 'N Telenor'
           |   subscription: 'unknown'
           |   registration: 'home'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/4'

  -------------------------
  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/7'

bjorn at nemi:~$ mmcli -b 7
Bearer '/org/freedesktop/ModemManager1/Bearer/7'
  -------------------------
  Status             |   connected: 'yes'
                     |   suspended: 'no'
                     |   interface: 'wwan1'
                     |  IP timeout: '20'
  -------------------------
  Properties         |         apn: 'telenor'
                     |     roaming: 'allowed'
                     |     IP type: 'ipv4'
                     |        user: 'none'
                     |    password: 'none'
                     |      number: 'none'
                     | Rm protocol: 'unknown'
  -------------------------
  IPv4 configuration |   method: 'unknown'
  -------------------------
  IPv6 configuration |   method: 'unknown'


And the debug log tells us why:



ModemManager[24901]: <debug> [1402489940.312179] [mm-bearer-qmi.c:725] connect_context_step(): Getting IPv4 configuration...
ModemManager[24901]: [/dev/cdc-wdm1] Sent message...
<<<<<< RAW:
<<<<<<   length = 20
<<<<<<   data   = 01:13:00:00:01:02:00:05:00:2D:00:07:00:10:04:00:30:E3:00:00
ModemManager[24901]: [/dev/cdc-wdm1] Sent message (translated)...
<<<<<< QMUX:
<<<<<<   length  = 19
<<<<<<   flags   = 0x00
<<<<<<   service = "wds"
<<<<<<   client  = 2
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 5
<<<<<<   tlv_length  = 7
<<<<<<   message     = "Get Current Settings" (0x002D)
<<<<<< TLV:
<<<<<<   type       = "Requested Settings" (0x10)
<<<<<<   length     = 4
<<<<<<   value      = 30:E3:00:00
<<<<<<   translated = dns-address, granted-qos, ip-address, gateway-info, mtu, domain-name-list, ip-family
ModemManager[24901]: [/dev/cdc-wdm1] Received message...
>>>>>> RAW:
>>>>>>   length = 18
>>>>>>   data   = 01:11:00:80:01:FF:04:00:00:22:00:05:00:01:02:00:02:00
ModemManager[24901]: [/dev/cdc-wdm1] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 17
>>>>>>   flags   = 0x80
>>>>>>   service = "wds"
>>>>>>   client  = 255
>>>>>> QMI:
>>>>>>   flags       = "indication"
>>>>>>   transaction = 0
>>>>>>   tlv_length  = 5
>>>>>>   message     = (0x0022)
>>>>>> TLV:
>>>>>>   type   = 0x01
>>>>>>   length = 2
>>>>>>   value  = 02:00
ModemManager[24901]: [/dev/cdc-wdm1] Received message...
>>>>>> RAW:
>>>>>>   length = 91
>>>>>>   data   = 01:5A:00:80:01:02:02:05:00:2D:00:4E:00:02:04:00:00:00:00:00:1E:04:00:ED:1F:B3:6D:15:04:00:04:70:D5:C1:16:04:00:C6:0F:43:82:20:04:00:EE:1F:B3:6D:21:04:00:FC:FF:FF:FF:17:21:00:04:80:21:00:00:C0:21:00:00:00:00:00:00:00:00:00:00:02:DC:05:00:00:04:07:03:00:00:00:00:01:00:00:00
ModemManager[24901]: [/dev/cdc-wdm1] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 90
>>>>>>   flags   = 0x80
>>>>>>   service = "wds"
>>>>>>   client  = 2
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 5
>>>>>>   tlv_length  = 78
>>>>>>   message     = "Get Current Settings" (0x002D)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "IPv4 Address" (0x1e)
>>>>>>   length     = 4
>>>>>>   value      = ED:1F:B3:6D
>>>>>>   translated = 1840455661
>>>>>> TLV:
>>>>>>   type       = "Primary IPv4 DNS Address" (0x15)
>>>>>>   length     = 4
>>>>>>   value      = 04:70:D5:C1
>>>>>>   translated = 3251990532
>>>>>> TLV:
>>>>>>   type       = "Secondary IPv4 DNS Address" (0x16)
>>>>>>   length     = 4
>>>>>>   value      = C6:0F:43:82
>>>>>>   translated = 2185433030
>>>>>> TLV:
>>>>>>   type       = "IPv4 Gateway Address" (0x20)
>>>>>>   length     = 4
>>>>>>   value      = EE:1F:B3:6D
>>>>>>   translated = 1840455662
>>>>>> TLV:
>>>>>>   type       = "IPv4 Gateway Subnet Mask" (0x21)
>>>>>>   length     = 4
>>>>>>   value      = FC:FF:FF:FF
>>>>>>   translated = 4294967292
>>>>>> TLV:
>>>>>>   type   = 0x17
>>>>>>   length = 33
>>>>>>   value  = 04:80:21:00:00:C0:21:00:00:00:00:00:00:00:00:00:00:02:DC:05:00:00:04:07:03:00:00:00:00:01:00:00:00
ModemManager[24901]: <debug> [1402489940.320635] [mm-bearer-qmi.c:475] get_current_settings_ready():  IP Family: failed (Field 'IP Family' was not found in the message)
ModemManager[24901]: <debug> [1402489940.321067] [mm-bearer-qmi.c:492] get_current_settings_ready():    Domains: failed (Field 'Domain Name List' was not found in the message)
ModemManager[24901]: <debug> [1402489940.321410] [mm-port.c:93] mm_port_set_connected(): (wwan1): port now connected
ModemManager[24901]: <debug> [1402489940.321869] [mm-bearer.c:489] connect_ready(): Connected bearer '/org/freedesktop/ModemManager1/Bearer/7'
ModemManager[24901]: <info>  [1402489940.322334] [mm-iface-modem.c:1392] __iface_modem_update_state_internal(): Modem /org/freedesktop/ModemManager1/Modem/4: state changed (connecting -> connected)
ModemManager[24901]: <info>  [1402489940.323778] [mm-iface-modem-simple.c:602] connection_step(): Simple connect state (8/8): All done



This modem does not support IPv6, so I guess the 'IP Family' TLV is just
left out as redundant?  In any case: All the TLVs are family specific so
it shouldn't really be a problem parsing them without the family TLV.

That's all I've got today. Don't have my other QMI and MBIM modems with
me.



Bjørn


More information about the ModemManager-devel mailing list