aboutgitcodebugslistschat
path: root/arp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-08-21 14:19:59 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-08-21 11:59:54 +0200
commit905ecd2b0b8a6ab68b66017ec47e094253233e74 (patch)
tree17b470748c32e17d690620315f293efded491fe4 /arp.c
parent066e69986b96bf83dfa2ec09f6b03b6a7ad6bbd6 (diff)
downloadpasst-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar.gz
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar.bz2
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar.lz
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar.xz
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.tar.zst
passt-905ecd2b0b8a6ab68b66017ec47e094253233e74.zip
treewide: Rename MAC address fields for clarity
c->mac isn't a great name, because it doesn't say whose mac address it is and it's not necessarily obvious in all the contexts we use it. Since this is specifically the address that we (passt/pasta) use on the tap interface, rename it to "our_tap_mac". Rename the "mac_guest" field to "guest_mac" to be grammatically consistent. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'arp.c')
-rw-r--r--arp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arp.c b/arp.c
index 93b22c5..53334da 100644
--- a/arp.c
+++ b/arp.c
@@ -72,7 +72,7 @@ int arp(const struct ctx *c, const struct pool *p)
ah->ar_op = htons(ARPOP_REPLY);
memcpy(am->tha, am->sha, sizeof(am->tha));
- memcpy(am->sha, c->mac, sizeof(am->sha));
+ memcpy(am->sha, c->our_tap_mac, sizeof(am->sha));
memcpy(swap, am->tip, sizeof(am->tip));
memcpy(am->tip, am->sip, sizeof(am->tip));
@@ -80,7 +80,7 @@ int arp(const struct ctx *c, const struct pool *p)
l2len = sizeof(*eh) + sizeof(*ah) + sizeof(*am);
memcpy(eh->h_dest, eh->h_source, sizeof(eh->h_dest));
- memcpy(eh->h_source, c->mac, sizeof(eh->h_source));
+ memcpy(eh->h_source, c->our_tap_mac, sizeof(eh->h_source));
tap_send_single(c, eh, l2len);