On Sun, Nov 14, 2021 at 10:40:28PM +0100, na...@poczta.fm wrote: > Hi misc@, > > While testing the U-blox MPCI-L210 LTE modem on OpenBSD -current > (the modem is attached as a cdce(4) device, the router mode is enabled; > other modes are also available), I noticed that the automatic configuration > via DHCP works correctly, but the MAC address assigned to the corresponding > cdce0 network interface is different from the MAC address reported by > lsusb -v. Unfortunately, due to this mismatch, incoming Ethernet frames > having the actual MAC address of the device set as the destination address > in the header are dropped by the kernel in the ether_input() function > (/src/sys/net/if_ethersubr.c). > > Based on an analysis of the source code (/sys/dev/usb/if_cdce.c) and the > results of the subsequent experiments, I was able to confirm that the cdce > driver is unable to get the MAC address of the device (in particular, > the usbd_get_string_desc() function returns USBD_STALLED instead of > USBD_NORMAL_COMPLETION), and as a result, a semi-random fake Ethernet > address is set: > > ----------------------------------------------------------------------------- > 306 if (!ethd || usbd_get_string_desc(sc->cdce_udev, ethd->iMacAddress, 0, > 307 &eaddr_str, &len)) { > 308 ether_fakeaddr(ifp); // <---- Set a semi-random MAC address > 309 } else { > -----------------------------------------------------------------------------
Can you find out what happens on Linux? Their cdc_ether driver seems to be doing exactly the same thing. So with this driver you would also end up with a random MAC if the device fails to respond to a mac address query. In this case I have no idea what else could be done apart from using the workaround you have already found. But Linux has more CDC sub-drivers than we do, and runs some devices in specialized modes. Perhaps Linux performs a mode switch and uses a different driver for e.g. MBIM mode? If that is the case then we could change our drivers to try to switch this device into a mode where it works better.