diff options
author | thompsa <thompsa@FreeBSD.org> | 2006-06-12 22:43:37 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2006-06-12 22:43:37 +0000 |
commit | 472f11195161d9f989673c61dee76ecef43fc6fc (patch) | |
tree | f12588d2c5048e5c1cc0c1e890b80f29481cc121 /sys/net/if_bridge.c | |
parent | 9ba77a73a09e40bdc867d7ace05f19492b877c6a (diff) | |
download | FreeBSD-src-472f11195161d9f989673c61dee76ecef43fc6fc.zip FreeBSD-src-472f11195161d9f989673c61dee76ecef43fc6fc.tar.gz |
Use bit operations to get a locally administered address rather than using a
hardcoded OUI code.
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index c2c30c3..ac46afc 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -501,8 +501,8 @@ bridge_clone_create(struct if_clone *ifc, int unit) ifp->if_hdrlen = ETHER_HDR_LEN; /* - * Generate a random ethernet address and use the private AC:DE:48 - * OUI code. + * Generate a random ethernet address with a locally administered + * address. * * Since we are using random ethernet addresses for the bridge, it is * possible that we might have address collisions, so make sure that @@ -510,9 +510,8 @@ bridge_clone_create(struct if_clone *ifc, int unit) */ for (retry = 1; retry != 0;) { arc4rand(eaddr, ETHER_ADDR_LEN, 1); - eaddr[0] = 0xAC; - eaddr[1] = 0xDE; - eaddr[2] = 0x48; + eaddr[0] &= ~1; /* clear multicast bit */ + eaddr[0] |= 2; /* set the LAA bit */ retry = 0; mtx_lock(&bridge_list_mtx); LIST_FOREACH(sc2, &bridge_list, sc_list) { |