Date: Sat, 26 Jun 2021 19:55:34 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 256850] poor mac address distribution for if_tap Message-ID: <bug-256850-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256850 Bug ID: 256850 Summary: poor mac address distribution for if_tap Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: maxim.shalomikhin@kaspersky.com Created attachment 226064 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D226064&action= =3Dedit Patch for sys/net/if_ethersubr.c I have a system with about 300 tap interfaces (openvpn tunnels) combined in= one bridge. After upgrading from releng/11.4 to releng/12.2 I noticed a lot of repeated MAC (ether) addresses on tap interfaces. How to reproduce: On FreeBSD 12 or 13, create ~100 tap interfaces, then check MACs for uniqueness: ifconfig -a | grep ether | sort | uniq -c | sort -r Quick FIX (change mac from userspace): ifconfig ${ov_dev} ether "00:bd:`jot -r -s ':' -w '%02x' 4`" According to sys/net/ieee_oui.h, MAC address for TAP must be "58:9c:fc:10:XX:XX" (65536 unique macs), but there are two issues with ether_gen_addr(): 1. Fourth byte sometimes "00" and sometimes "10" (minor issue) 2. Fifth byte in ~50% cases is FF (major issue due to char digest[] is sign= ed) So it's only ~256 unique macs for tap and this is very annoying. The small patch (tested on amd64 13.0-RELEASE-p2) attached. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256850-227>