From 5ca89b31210b249f79a1a5cd1a258c85fdb7970e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 7 Aug 2013 02:30:23 +0200 Subject: Guard socket options not available on FreeBSD --- src/config.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 0decec8..3ee5a76 100644 --- a/src/config.c +++ b/src/config.c @@ -212,7 +212,12 @@ bool fastd_config_crypto(fastd_context_t *ctx, fastd_config_t *conf, const char return false; } -void fastd_config_bind_address(fastd_context_t *ctx, fastd_config_t *conf, const fastd_peer_address_t *address, const char *bindtodev, bool default_v4, bool default_v6) { +bool fastd_config_bind_address(fastd_context_t *ctx, fastd_config_t *conf, const fastd_peer_address_t *address, const char *bindtodev, bool default_v4, bool default_v6) { +#ifndef USE_BINDTODEVICE + if (bindtodev) + return false; +#endif + fastd_bind_address_t *addr = malloc(sizeof(fastd_bind_address_t)); addr->next = conf->bind_addrs; conf->bind_addrs = addr; @@ -228,6 +233,8 @@ void fastd_config_bind_address(fastd_context_t *ctx, fastd_config_t *conf, const if (addr->addr.sa.sa_family != AF_INET && (default_v6 || !conf->bind_addr_default_v6)) conf->bind_addr_default_v6 = addr; + + return true; } void fastd_config_peer_group_push(fastd_context_t *ctx, fastd_config_t *conf, const char *name) { @@ -612,6 +619,11 @@ void fastd_configure(fastd_context_t *ctx, fastd_config_t *conf, int argc, char if (!conf->peers && !has_peer_group_peer_dirs(conf->peer_group)) exit_error(ctx, "config error: neither fixed peers nor peer dirs have been configured"); +#ifndef USE_PMTU + if (conf->pmtu.set) + exit_error(ctx, "config error: setting pmtu is not supported on this system"); +#endif + configure_user(ctx, conf); ctx->conf = conf; -- cgit v1.2.3