aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-08-21 14:20:14 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-08-21 12:00:28 +0200
commit90e83d50a9bdeb0697843fc9917c3070b69d5c7d (patch)
tree3cb31d19ff1c3897ebd34874e4e74090bfdda221 /util.h
parent356de97e432e21e8711b94b06a53b1e16dadd913 (diff)
downloadpasst-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar.gz
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar.bz2
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar.lz
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar.xz
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.tar.zst
passt-90e83d50a9bdeb0697843fc9917c3070b69d5c7d.zip
Don't take "our" MAC address from the host
When sending frames to the guest over the tap link, we need a source MAC address. Currently we take that from the MAC address of the main interface on the host, but that doesn't actually make much sense: * We can't preserve the real MAC address of packets from anywhere external so there's no transparency case here * In fact, it's confusingly different from how we handle IP addresses: whereas we give the guest the same IP as the host, we're making the host's MAC the one MAC that the guest *can't* use for itself. * We already need a fallback case if the host doesn't have an Ethernet like MAC (e.g. if it's connected via a point to point interface, such as a wireguard VPN). Change to just just use an arbitrary fixed MAC address - I've picked 9a:55:9a:55:9a:55. It's simpler and has the small advantage of making the fact that passt/pasta is in use typically obvious from guest side packet dumps. This can still, of course, be overridden with the -M option. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r--util.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/util.h b/util.h
index a716849..87b91e6 100644
--- a/util.h
+++ b/util.h
@@ -96,7 +96,6 @@
#define PORT_IS_EPHEMERAL(port) ((port) >= PORT_EPHEMERAL_MIN)
#define MAC_ZERO ((uint8_t [ETH_ALEN]){ 0 })
-#define MAC_LAA ((uint8_t [ETH_ALEN]){ BIT(1), 0, 0, 0, 0, 0 })
#define MAC_IS_ZERO(addr) (!memcmp((addr), MAC_ZERO, ETH_ALEN))
#ifndef __bswap_constant_16