diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-20 16:50:51 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-20 16:50:51 +0200 |
commit | 4d2db5dbd2a84bee7d69bf8929ce4914ae528547 (patch) | |
tree | 3db94cd184e968d11992fd6b6e395e67afb8aae1 /src | |
parent | d52f208d9fb6381f3c3656c5916866a4b779fa82 (diff) | |
download | fastd-4d2db5dbd2a84bee7d69bf8929ce4914ae528547.tar fastd-4d2db5dbd2a84bee7d69bf8929ce4914ae528547.zip |
OpenBSD doesn't support IPv4 on IPv6 sockets
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index ed1c332..7dd3e7f 100644 --- a/src/config.c +++ b/src/config.c @@ -218,6 +218,21 @@ bool fastd_config_bind_address(fastd_context_t *ctx UNUSED, fastd_config_t *conf return false; #endif +#ifndef USE_MULTIAF_BIND + if (address->sa.sa_family == AF_UNSPEC) { + fastd_peer_address_t addr4 = { .in = { .sin_family = AF_INET, .sin_port = address->in.sin_port } }; + fastd_peer_address_t addr6 = { .in6 = { .sin6_family = AF_INET6, .sin6_port = address->in.sin_port } }; + + if (!fastd_config_bind_address(ctx, conf, &addr4, bindtodev, default_v4, default_v6)) + return false; + + if (!fastd_config_bind_address(ctx, conf, &addr6, bindtodev, default_v4, default_v6)) + return false; + + return true; + } +#endif + fastd_bind_address_t *addr = malloc(sizeof(fastd_bind_address_t)); addr->next = conf->bind_addrs; conf->bind_addrs = addr; |