Ethernet over USB and UDEV

Mikko Rauhala mjrauhal at cc.helsinki.fi
Sun May 3 22:35:18 CEST 2009


su, 2009-05-03 kello 23:13 +0200, Esben Stien kirjoitti:
> These type of "cables" presents itself to the operating system as
> Ethernet over USB devices, ie, network cards, but without any MAC
> address. This address has to be given by the operating system. 

Hm. I was under the impression that a USB ethernet gadget (for instance,
Neo) gives its MAC (which may be randomized from the locally
administered address space, if there's no reservation otherwise) to the
host, simply because it makes sense for a USB network adapter to work
this way - it's how every other kind of ethernet adapter does it... Thus
the gadget would be in control and a well-behaved gadget could have a
constant MAC (or not, as it happens, but this wouldn't be a general
property of Ethernet over USB devices).

This ol' bug entry and its first comment here seems to support my idea
of what's going on: http://docs.openmoko.org/trac/ticket/1023

"I don't think we need any kernel patches for this. The kernel very well
supports fixed MAC addresses that are provided to it at kernel boot time
parameter." - laforge

It would be nice if that could be changed other than giving a boot
parameter; then the first boot could, before initializing USB
networking, load the BT MAC (again possibly flipping the local bit),
store it under /etc (for the following bootups, no need to power-up BT),
and use that.

'course, what you could do without tweaking the kernel is check the
bootloader's parameters for a MAC setting on boot, and if there isn't
any, stick the current purely randomized MAC in there. This would ensure
that the same randomized MAC would remain in use as long as the
bootloader settings remain, and would be implementable wholly in
userspace, given tools to read/write the bootloader environment.
Downside: no clear relationship to an existing MAC in the device, but
perhaps people can live without that. ;]

-- 
Mikko Rauhala <mjr at iki.fi>       - http://www.iki.fi/mjr/blog/  
The Finnish Pirate Party         - http://piraattipuolue.fi/  
World Transhumanist Association  - http://transhumanism.org/  
Singularity Institute            - http://singinst.org/  





More information about the support mailing list