aboutgitcodebugslistschat
path: root/util.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-07-22 15:31:18 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-07-30 22:14:07 +0200
commit16f5586bb811dd344c3bbeadc88f30568986adbc (patch)
tree5ddf4027edb4867adb94dcd62870d9d9a6f3ac49 /util.c
parent5e12d23acbda8871848c6221a4f14e5b7daff66f (diff)
downloadpasst-16f5586bb811dd344c3bbeadc88f30568986adbc.tar
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.tar.gz
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.tar.bz2
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.tar.lz
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.tar.xz
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.tar.zst
passt-16f5586bb811dd344c3bbeadc88f30568986adbc.zip
Make substructures for IPv4 and IPv6 specific context information
The context structure contains a batch of fields specific to IPv4 and to IPv6 connectivity. Split those out into a sub-structure. This allows the conf_ip4() and conf_ip6() functions, which take the entire context but touch very little of it, to be given more specific parameters, making it clearer what it affects without stepping through the code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index f4ec102..9b87b65 100644
--- a/util.c
+++ b/util.c
@@ -278,8 +278,8 @@ int sock_l4(const struct ctx *c, int af, uint8_t proto,
if (bind_addr) {
addr6.sin6_addr = *(struct in6_addr *)bind_addr;
- if (!memcmp(bind_addr, &c->addr6_ll,
- sizeof(c->addr6_ll)))
+ if (!memcmp(bind_addr, &c->ip6.addr_ll,
+ sizeof(c->ip6.addr_ll)))
addr6.sin6_scope_id = c->ifi6;
} else {
addr6.sin6_addr = in6addr_any;