summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fastd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 63c5750..b78fa34 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -257,7 +257,7 @@ static int bind_socket(fastd_context_t *ctx, const fastd_bind_address_t *addr, b
bind_address.in.sin_port = addr->addr.in.sin_port;
}
- if (bind(fd, (struct sockaddr*)&bind_address, af == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))) {
+ if (bind(fd, (struct sockaddr*)&bind_address, bind_address.sa.sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))) {
if (warn)
pr_warn_errno(ctx, "bind");
goto error;