From: Stéphane Graber Date: Sun, 16 Mar 2025 06:20:02 +0000 (-0400) Subject: global: Switch MAC generation to Zabbly prefix X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bd24f6cbf116c3e49d29d6ccfffdb9c3e92b328;p=thirdparty%2Flxc.git global: Switch MAC generation to Zabbly prefix Zabbly obtained the 10:66:6a MAC address prefix for use by the Linux Containers project. Signed-off-by: Stéphane Graber --- diff --git a/config/etc/default.conf.lxcbr b/config/etc/default.conf.lxcbr index e53047d8b..b513e2ac0 100644 --- a/config/etc/default.conf.lxcbr +++ b/config/etc/default.conf.lxcbr @@ -1,4 +1,4 @@ lxc.net.0.type = veth lxc.net.0.link = lxcbr0 lxc.net.0.flags = up -lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx +lxc.net.0.hwaddr = 10:66:6a:xx:xx:xx diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in index 06b632b10..516f1d83e 100755 --- a/config/init/common/lxc-net.in +++ b/config/init/common/lxc-net.in @@ -9,7 +9,7 @@ varlib="@LOCALSTATEDIR@/lib" USE_LXC_BRIDGE="true" LXC_BRIDGE="lxcbr0" -LXC_BRIDGE_MAC="00:16:3e:00:00:00" +LXC_BRIDGE_MAC="10:66:6a:00:00:00" LXC_ADDR="10.0.3.1" LXC_NETMASK="255.255.255.0" LXC_NETWORK="10.0.3.0/24" diff --git a/lxc.spec.in b/lxc.spec.in index 3385df153..e7026ee11 100644 --- a/lxc.spec.in +++ b/lxc.spec.in @@ -170,7 +170,7 @@ USE_LXC_BRIDGE="true" # If you have the dnsmasq daemon installed, you'll also have to update # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon. LXC_BRIDGE="lxcbr0" -LXC_BRIDGE_MAC="00:16:3e:00:00:00" +LXC_BRIDGE_MAC="10:66:6a:00:00:00" LXC_ADDR="$SUBNET.1" LXC_NETMASK="255.255.255.0" LXC_NETWORK="$SUBNET.0/24" diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index 24eb46acf..79833fd2d 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -775,13 +775,13 @@ bool new_hwaddr(char *hwaddr) seed = randseed(false); - ret = strnprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", rand_r(&seed) % 255, + ret = strnprintf(hwaddr, 18, "10:66:6a:%02x:%02x:%02x", rand_r(&seed) % 255, rand_r(&seed) % 255, rand_r(&seed) % 255); #else (void)randseed(true); - ret = strnprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", rand() % 255, + ret = strnprintf(hwaddr, 18, "10:66:6a:%02x:%02x:%02x", rand() % 255, rand() % 255, rand() % 255); #endif if (ret < 0) diff --git a/src/tests/get_item.c b/src/tests/get_item.c index 9e74f8a23..40cc564ad 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -548,7 +548,7 @@ int main(int argc, char *argv[]) goto out; } - if (!c->set_config_item(c, "lxc.net.0.hwaddr", "00:16:3e:xx:xx:xx")) { + if (!c->set_config_item(c, "lxc.net.0.hwaddr", "10:66:6a:xx:xx:xx")) { fprintf(stderr, "%d: failed to set network.hwaddr\n", __LINE__); goto out; } diff --git a/src/tests/lxc-test-createconfig b/src/tests/lxc-test-createconfig index dc40c10ad..e6b7e4b48 100755 --- a/src/tests/lxc-test-createconfig +++ b/src/tests/lxc-test-createconfig @@ -20,7 +20,7 @@ trap cleanup EXIT cat > $f << EOF lxc.net.0.type = veth -lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx +lxc.net.0.hwaddr = 10:66:6a:xx:xx:xx EOF lxc-create -t busybox -f $f -n lxctestc grep -q "xx:xx" /var/lib/lxc/lxctestc/config && { echo "hwaddr not expanded"; exit 1; }