Keep track of tetherable USB interfaces in both up and down link states.
USB network interfaces that are present-since-boot are never issued "added" (or "removed", for that matter) notifications from netd, and thus, are only discovered by Tethering when their link state changes. Prior to this commit, such interfaces were only tracked on change to "up" link state, even though the interfaces were _not_ removed on changes to "down" state. On some devices (e.g., epicmtd) a change to "up" state only occurs after (i) IFF_UP is set on the interface, (ii) the rndis USB gadget function is enabled, and (iii) a USB cable is connected to another machine. Since rndis is enabled immediately before the start of USB tethering, the "up" state is achieved asynchronously, and often _after_ Tethering looks for a tetherable interface. However, "down" state is synchronously reported when IFF_UP is set, and thus, serves as an effective mechanism to notify Tethering about the existence of the interface.
Loading
Please register or sign in to comment