Modify cdc-ncm driver to obtain initial MAC address via GET_NET_ADDRESS request |
|||
Issue descriptionWhen debugging issue 457364, we observed that the MAC address of a MBIM modem keeps changing across reboots. The issue lies in the current implementation of the cdc-ncm driver in Linux kernel. When binding the cdc_ncm driver to a USB device that exposes a CDC NCM function, the driver sets the MAC address of the associated net device only if the device also implements the CDC ECM function as the associated Ethernet Functional Descriptor provides the EUI-48 address via the iMACAddress field. However, a NCM device doesn't always implement the ECM function. For example, a MBIM device may not implement the ECM function, or even if it does, the ECM function may be implemented under a different USB configuration. In those cases, the net device uses a randomized MAC address generated in the usbnet driver. The MAC address is typically a useful identifier that we want to obtain it reliably. Fortunately, CDC NCM supports a class-specific "GET_NET_ADDRESS" request for retrieving the current EUI-48 address, which is expected to be same as the permanent EUI-48 address given by the iMACAddress field on the Ethernet Functional Descriptor unless a "SET_NET_ADDRESS" request is issued to change the current EUI-48 address. This issue proposes modifying the cdc-ncm driver to retrieve the EUI-48 address via a GET_NET_ADDRESS request during binding, and if the request succeeds, assign the EUI-48 address as the initial MAC address on the associated net device, which addresses the situation when no Ethernet Functional Descriptor is available. If the Ethernet Functional Descriptor is available, the initial MAC address will still be updated according to the iMACAddress field. In the worst case when the EUI-48 address can't be obtained via GET_NET_ADDRESS or iMACAddress, the randomized MAC address is used.
,
Sep 30 2016
Here's the proposed fix: https://chromium-review.googlesource.com/#/c/390361/
,
Oct 28 2016
,
Nov 9 2016
https://chromium-review.googlesource.com/#/c/390361/ tries to use NCM GET_NET_ADDRESS control command, as a fallback, but unfortunately, GET_NET_ADDRESS isn't always available. Instead of trying to get a consistent MAC address from the modem, shill has been modified to use other modem identifiers (https://chromium-review.googlesource.com/#/c/403519/). Closing this bug as WontFix. |
|||
►
Sign in to add a comment |
|||
Comment 1 by benchan@chromium.org
, Sep 28 2016