What makes a good fake MAC address?
Subsystems (2)
Hi All
The Intel i2400m WiMAX driver behaves as an ethernet device, and currently when sending packets to the netdev stack, it fakes an ethernet header, sets the "from" mac address to zeroes and the "to" to it's own MAC address.
The WiMAX network can be considered to be a point-to-point (up to the gateway) connection, all IP based, so there are not MAC addresses from our gateway (not to mention that it can change behind us).
The problem with using a zero mac address is that it confuses the bridging software (and maybe others). I was wondering, what would be a fake mac address we could put in there that is legal for this kind of "faking"? [or the closest thing to legal?]
Thanks!
Signature · 1 line
Inaky
Quoted 12 lines · On Wed, 22 Apr 2009 13:48:27 -0700 Inaky Perez-Gonzalez…
Hi All
The Intel i2400m WiMAX driver behaves as an ethernet device, and currently when sending packets to the netdev stack, it fakes an ethernet header, sets the "from" mac address to zeroes and the "to" to it's own MAC address.
The WiMAX network can be considered to be a point-to-point (up to the gateway) connection, all IP based, so there are not MAC addresses from our gateway (not to mention that it can change behind us).
Quoted 7 lines
The problem with using a zero mac address is that it confuses the bridging software (and maybe others). I was wondering, what would be a fake mac address we could put in there that is legal for this kind of "faking"? [or the closest thing to legal?]
Thanks!
You want really want hw to have real mac, but if not use random_ether_addr()
Quoted 10 lines · Inaky Perez-Gonzalez
Hi All
The Intel i2400m WiMAX driver behaves as an ethernet device, and currently when sending packets to the netdev stack, it fakes an ethernet header, sets the "from" mac address to zeroes and the "to" to it's own MAC address.
The WiMAX network can be considered to be a point-to-point (up to the gateway) connection, all IP based, so there are not MAC addresses from our gateway (not to mention that it can change behind us).
Quoted 7 lines
The problem with using a zero mac address is that it confuses the bridging software (and maybe others). I was wondering, what would be a fake mac address we could put in there that is legal for this kind of "faking"? [or the closest thing to legal?]
Thanks!
We have random_ether_addr(), it should be self explained :)
/**
* random_ether_addr - Generate software assigned random Ethernet address
* @addr: Pointer to a six-byte array containing the Ethernet address *
* Generate a random Ethernet address (MAC) that is not multicast
* and has the local assigned bit set.
*/
static inline void random_ether_addr(u8 *addr)
{
get_random_bytes (addr, ETH_ALEN);
addr [0] &= 0xfe; /* clear multicast bit */
addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
}Quoted 12 lines · Eric Dumazet
Quoted 11 lines · Inaky Perez-Gonzalez
Hi All
The Intel i2400m WiMAX driver behaves as an ethernet device, and currently when sending packets to the netdev stack, it fakes an ethernet header, sets the "from" mac address to zeroes and the "to" to it's own MAC address.
The WiMAX network can be considered to be a point-to-point (up to the gateway) connection, all IP based, so there are not MAC addresses from our gateway (not to mention that it can change behind us).
Quoted 8 lines
Quoted 6 lines
The problem with using a zero mac address is that it confuses the bridging software (and maybe others). I was wondering, what would be a fake mac address we could put in there that is legal for this kind of "faking"? [or the closest thing to legal?]
Thanks!
We have
random_ether_addr(), it should be self explained :)
(Also in reply to Stephen's comment) the device has its own local address; what we are faking is the address the packet comes from.
According to random_ether_addr(), it sets the local bits; will this work to fake the "other end of the connection"? (for which there is an IP address but no MAC address, it being a pure IP link).
Thanks,
Signature · 1 line
Inaky