aboutgitcodebugslistschat
path: root/ndp.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 /ndp.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 'ndp.c')
-rw-r--r--ndp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ndp.c b/ndp.c
index 6dcb487..9c0fef4 100644
--- a/ndp.c
+++ b/ndp.c
@@ -247,7 +247,7 @@ int ndp(struct ctx *c, const struct icmp6hdr *ih, const struct in6_addr *saddr,
memcpy(&na.target_addr, &ns->target_addr,
sizeof(na.target_addr));
- memcpy(na.target_l2_addr.mac, c->mac, ETH_ALEN);
+ memcpy(na.target_l2_addr.mac, c->our_tap_mac, ETH_ALEN);
} else if (ih->icmp6_type == RS) {
size_t dns_s_len = 0;
@@ -331,7 +331,7 @@ int ndp(struct ctx *c, const struct icmp6hdr *ih, const struct in6_addr *saddr,
}
dns_done:
- memcpy(&ra.source_ll.mac, c->mac, ETH_ALEN);
+ memcpy(&ra.source_ll.mac, c->our_tap_mac, ETH_ALEN);
} else {
return 1;
}