From 672eaeb2be1ce3176083017283389d0c0bd5d052 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 20 Nov 2020 12:53:17 +0100 Subject: tunnel: T3068: automatic generate link-local adresses --- python/vyos/ifconfig/tunnel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index 05520ba84..7264b6296 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -142,9 +142,9 @@ class _Tunnel(Interface): """ # we choose 40 random bytes for the MAC address, this gives # us e.g. EUI('00-EA-EE-D6-A3-C8') or EUI('00-41-B9-0D-F2-2A') - tmp = EUI(getrandbits(40)).value + tmp = EUI(getrandbits(48)).value # set locally administered bit in MAC address - tmp |= 0x020000000000 + tmp |= 0xf20000000000 # convert integer to "real" MAC address representation mac = EUI(hex(tmp).split('x')[-1]) # change dialect to use : as delimiter instead of - -- cgit v1.2.3