Bug 211984 - adding randomized MAC ifconfig option ?
Summary: adding randomized MAC ifconfig option ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Marcelo Araujo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-19 08:12 UTC by Kurt Jaeger
Modified: 2018-03-29 05:02 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Jaeger freebsd_committer freebsd_triage 2016-08-19 08:12:44 UTC
Please have a look at

https://gist.github.com/t6/05e2959c5583ecdce2487c1557f784b7

would it be possible to integrate this patch ?
Comment 1 Marcelo Araujo freebsd_committer freebsd_triage 2016-08-23 14:00:08 UTC
I'm taking it!
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-23 14:33:02 UTC
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.
Comment 3 Marcelo Araujo freebsd_committer freebsd_triage 2016-08-23 14:37:06 UTC
(In reply to Kurt Jaeger from comment #2)

The OpenBSD implementation doesn't handle these cases?
Comment 4 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-23 14:41:47 UTC
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).
Comment 5 Marcelo Araujo freebsd_committer freebsd_triage 2016-08-23 15:37:34 UTC
(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.
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-09-16 04:22:57 UTC
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
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2016-09-19 15:34:43 UTC
Self-reminder: Does it cover the special addresses from

https://en.wikipedia.org/wiki/Multicast_address
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-03-29 05:02:03 UTC
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