summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-12-13 18:02:39 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-12-13 18:02:39 +0100
commit766a0c145dad84b9af35b2bebc032be71509b3df (patch)
treea3fc10504338df57c208aa938b6db8b1d2c661b1 /src/config.c
parent505eb464948d32f9ae5d7f8d48d89dde98972930 (diff)
downloadfastd-766a0c145dad84b9af35b2bebc032be71509b3df.tar
fastd-766a0c145dad84b9af35b2bebc032be71509b3df.zip
Always convert v4-mapped IPv6 addresses to IPv4 addresses
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 09a0adc..8ae1ca6 100644
--- a/src/config.c
+++ b/src/config.c
@@ -236,10 +236,12 @@ void fastd_config_bind_address(fastd_context *ctx, fastd_config *conf, const fas
addr->addr = *address;
addr->bindtodev = bindtodev ? strdup(bindtodev) : NULL;
- if (address->sa.sa_family != AF_INET6 && (default_v4 || !conf->bind_addr_default_v4))
+ fastd_peer_address_simplify(&addr->addr);
+
+ if (addr->addr.sa.sa_family != AF_INET6 && (default_v4 || !conf->bind_addr_default_v4))
conf->bind_addr_default_v4 = addr;
- if (address->sa.sa_family != AF_INET && (default_v6 || !conf->bind_addr_default_v6))
+ if (addr->addr.sa.sa_family != AF_INET && (default_v6 || !conf->bind_addr_default_v6))
conf->bind_addr_default_v6 = addr;
}