Please have a look at https://gist.github.com/t6/05e2959c5583ecdce2487c1557f784b7 would it be possible to integrate this patch ?
I'm taking it!
I vaguely remember that some MAC adresses have special meaning (multicast etc?). The code should avoid those, if the random number generator returns those values. Probably some IEEE 802.3 reading is required.
(In reply to Kurt Jaeger from comment #2) The OpenBSD implementation doesn't handle these cases?
I looked at the github link, and for me it looks too simple to really cover all the bases (gut feeling, I did not read up on 802.3).
(In reply to Kurt Jaeger from comment #4) Yes, there are some restrictions such like: https://tools.ietf.org/html/rfc5342#section-2.1.1 https://tools.ietf.org/html/rfc5342#section-2.2.2 https://tools.ietf.org/html/rfc5342#section-2.3.1 https://tools.ietf.org/html/rfc5342#section-2.3.2 I might have overlooked some other.
A commit references this bug: Author: araujo Date: Fri Sep 16 04:22:21 UTC 2016 New revision: 305860 URL: https://svnweb.freebsd.org/changeset/base/305860 Log: Add an option called "random" that combined with "ether" can generate a random MAC address for an Ethernet interface. PR: 211984 Submitted by: pi@ Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock Approved by: wblock (manpages) Changes: head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.8
Self-reminder: Does it cover the special addresses from https://en.wikipedia.org/wiki/Multicast_address
A commit references this bug: Author: araujo Date: Thu Mar 29 05:01:50 UTC 2018 New revision: 331729 URL: https://svnweb.freebsd.org/changeset/base/331729 Log: MFC r305860, r306371 r305860: Add an option called "random" that combined with "ether" can generate a random MAC address for an Ethernet interface. PR: 211984 Submitted by: pi@ Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock Approved by: wblock (manpages) r306371: Indicate that this is a locally administered MAC address. Submitted by: lidl Differential Revision: https://reviews.freebsd.org/D7903 PR: 226459 Requested by: tobik Changes: _U stable/11/ stable/11/sbin/ifconfig/af_link.c stable/11/sbin/ifconfig/ifconfig.8