Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAC address variation breaks enXX enumeration (or, Interfaces! Interfaces everywhere!) #21

Open
jashank opened this issue Mar 7, 2014 · 1 comment

Comments

@jashank
Copy link

jashank commented Mar 7, 2014

For reasons I don't entirely understand (and a brief rummage through I/O Kit (shudder) didn't enlighten me) it appears that the enXX enumeration issue is related to MAC addresses changing. I'll guess it's something related to SystemConfiguration management that forces enumeration of a new device because it's not been seen before.

Allow me to demonstrate.

  1. Tether a phone.
  2. Do ioreg -l | grep IOMACAddress > snap.a
  3. Untether the phone. I opt to simply unplug it (yes, yes, it could panic, I know, but 99 times out of 100 it doesn't) to make sure it's nicely forgotten about.
  4. Tether the phone.
  5. Do ioreg -l | grep IOMACAddress > snap.b
  6. diff -u snap.a snap.b

I've deliberately left the MAC addresses that the interface uses unmangled to demonstrate that they are so different, and also because they're basically transient LAAs.

 --- snap.a  2014-03-07 14:04:12.000000000 +1100
 +++ snap.b  2014-03-07 14:04:40.000000000 +1100
 @@ -1,5 +1,5 @@
      | |   |       |           |     |   "IOMACAddress" = <d2001bXXXXXX>
 -    | |   |     |   |   "IOMACAddress" = <ae931d149224>
 +    | |   |     |   |   "IOMACAddress" = <e2949d54a44a>
      | |   |   |   |   "IOMACAddress" = <c82a14XXXXXX>
      | |   |       |   "IOMACAddress" = <e0f847XXXXXX>
      | |   |       | |   "IOMACAddress" = <e0f847XXXXXX>

That's not the only place; in the hundred-odd examples I have in NetworkInterfaces.plist, the IOMacAddress data changes.

I haven't checked this on any other platforms or with other phones, but I suspect this is where the issue is coming from.

@jwise
Copy link
Owner

jwise commented Mar 7, 2014

Yeah, this is kind of what I figured was going on. The thing that still boggles me is that I don't understand why it works after people rm the NetworkInterfaces plist! Why would that help? What does recreating it do?

One thing that might be interesting, although a violation of the RNDIS spec, would be to hash the device serial number to get a MAC address instead.

Really, I'd like to modify the IOKit side to get it to do what I want, but I don't see an easy path to do that. When I tried modifying IOKit parameters before -- for instance, changing the 'ethernet' icon to a 'phone' icon by changing the device class, or changing the 'en' prefix to 'rndis' to make it easier to identify these devices, I would somehow manage to permanently wedge the driver stack until I rebooted. (I gave up doing that after getting frustrated after having to reboot the machine for the fourth or fifth time to continue development.)

By the way, untethering vs. unplugging shouldn't change whether the system crashes. Both appear the same to the Mac side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants