qmicli and IPv4 / IPv6

Bjørn Mork bjorn at mork.no
Mon May 23 07:13:16 UTC 2016


Andre Valentin <avalentin at marcant.net> writes:

> Hi !
>
> I analyzed the original firmware yesterday evening and also found this. I extended qmicli with a IP family patch
> to add this this to the start-network command.
>
> I tried to implement it like it is done with uqmi (the original openwrt qmi client) like this:
> ------------
> CID1=$(qmicli -p -d /dev/cdc-wdm0 --wds-noop --client-no-release-cid|grep CID|cut -d\' -f2)
> qmicli -v -p -d /dev/cdc-wdm0 --wds-start-network=apn=internet.t-mobile,family=4 --client-cid=$CID1 --client-no-release-cid
>
> CID2=$(qmicli -p -d /dev/cdc-wdm0 --wds-noop --client-no-release-cid|grep CID|cut -d\' -f2)
> qmicli -v -p -d /dev/cdc-wdm0 --wds-start-network=apn=internet.t-mobile,family=6 --client-cid=$CID2 --client-no-release-cid
> ------------
> But qmicli gives me a POLICY MISMATCH error where uqmi works. I traced the writes to the the qmi device and
> saw the following differences:
>
> uqmi
> 3304  write(4, "\1$\0\0\1\10\0\2\0 \0\30\0\24\21\0internet.t-mobile\26\1\0\3", 37) = 37

Translates to:

<<<<<< QMUX:
<<<<<<   length  = 36
<<<<<<   flags   = 0x00
<<<<<<   service = "wds"
<<<<<<   client  = 8
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 2
<<<<<<   tlv_length  = 24
<<<<<<   message     = "Start Network" (0x0020)
<<<<<< TLV:
<<<<<<   type       = "APN" (0x14)
<<<<<<   length     = 17
<<<<<<   value      = 69:6E:74:65:72:6E:65:74:2E:74:2D:6D:6F:62:69:6C:65
<<<<<<   translated = internet.t-mobile
<<<<<< TLV:
<<<<<<   type       = "Authentication Preference" (0x16)
<<<<<<   length     = 1
<<<<<<   value      = 03
<<<<<<   translated = pap, chap

> qmicli
> 3415  write(5, "\1$\0\0\1\n\0\1\0 \0\30\0\31\1\0\4\24\21\0internet.t-mobile", 37) = 37

Translates to:

<<<<<< QMUX:
<<<<<<   length  = 36
<<<<<<   flags   = 0x00
<<<<<<   service = "wds"
<<<<<<   client  = 10
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 24
<<<<<<   message     = "Start Network" (0x0020)
<<<<<< TLV:
<<<<<<   type       = "IP Family Preference" (0x19)
<<<<<<   length     = 1
<<<<<<   value      = 04
<<<<<<   translated = ipv4
<<<<<< TLV:
<<<<<<   type       = "APN" (0x14)
<<<<<<   length     = 17
<<<<<<   value      = 69:6E:74:65:72:6E:65:74:2E:74:2D:6D:6F:62:69:6C:65
<<<<<<   translated = internet.t-mobile


I believe the "IP Family Preference" TLV is the problem.  QMI provides
two ways to set this.  Setting the global preference (which is what
you've updated) and setting the local preference using this "Start
Network" TLV.  We don't have any docs, so we don't know how this was
meant to be used by Qualcomm.  But one guess is that the TLV was added
later to avoid having to use two separate commands.  Which doesn't
really help much if you are supporting both old and new firmwares...

Anyway, it looks like your problem is the obvious mismatch.  Try
updating the "Start Network" too when selecting IPv6. I don't think the
authentication preference is relevant unless you send credentials.  But
it doesn't seem to harm either.




Bjørn


More information about the libqmi-devel mailing list