Page MenuHomeFreeBSD

D61594.1794827862.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61594.1794827862.diff

diff --git a/sys/net/ieee_oui.h b/sys/net/ieee_oui.h
--- a/sys/net/ieee_oui.h
+++ b/sys/net/ieee_oui.h
@@ -69,13 +69,13 @@
#define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x0fffff)
/*
- * Allocate 16 bits for a pool to give to various interfaces that need a
+ * Allocate 20 bits for a pool to give to various interfaces that need a
* generated address, but don't quite need to slice off a whole section of
* the OUI (e.g. cloned interfaces, one-off NICs of various vendors).
*
* ether_gen_addr should be used to generate an address from this pool.
*/
-#define OUI_FREEBSD_GENERATED_MASK 0x10ffff
+#define OUI_FREEBSD_GENERATED_MASK 0x1fffff
#define OUI_FREEBSD_GENERATED_LOW OUI_FREEBSD(0x100000)
#define OUI_FREEBSD_GENERATED_HIGH OUI_FREEBSD(OUI_FREEBSD_GENERATED_MASK)
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1430,7 +1430,8 @@
SHA1Final(digest, &ctx);
free(buf, M_TEMP);
- addr = (digest[0] << 8) | digest[1] | OUI_FREEBSD_GENERATED_LOW;
+ addr = ((uint64_t)digest[0] << 12) | ((uint64_t)digest[1] << 4) |
+ (digest[2] >> 4) | OUI_FREEBSD_GENERATED_LOW;
for (i = 0; i < ETHER_ADDR_LEN; ++i) {
hwaddr->octet[i] = addr >> ((ETHER_ADDR_LEN - i - 1) * 8) &
0xFF;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 16, 11:17 AM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41775132
Default Alt Text
D61594.1794827862.diff (1 KB)

Event Timeline