diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-06-13 17:32:23 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-07-11 16:52:52 -0400 |
commit | 3136a82b9d76283b10244a9768e1f325503995d5 (patch) | |
tree | 72d408daac5933c3a245448ee64e0fe6e26dd2eb /src/providers | |
parent | 570c8a9351b28582301d2ce6b5de3b23f72ee583 (diff) | |
download | sssd-3136a82b9d76283b10244a9768e1f325503995d5.tar.gz sssd-3136a82b9d76283b10244a9768e1f325503995d5.tar.xz sssd-3136a82b9d76283b10244a9768e1f325503995d5.zip |
Split reading resolver family order into a separate function
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/data_provider_fo.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 8427d297e..3d726da19 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -65,38 +65,18 @@ int be_fo_is_srv_identifier(const char *server) static int be_fo_get_options(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, struct fo_options *opts) { - char *str_opt; - int ret; + errno_t ret; /* todo get timeout from configuration */ opts->retry_timeout = 30; opts->srv_retry_timeout = 14400; - ret = confdb_get_string(ctx->cdb, mem_ctx, ctx->conf_path, - CONFDB_DOMAIN_FAMILY_ORDER, - "ipv4_first", &str_opt); + ret = resolv_get_family_order(ctx->cdb, ctx->conf_path, + &opts->family_order); if (ret != EOK) { return ret; } - DEBUG(7, ("Lookup order: %s\n", str_opt)); - - if (strcasecmp(str_opt, "ipv4_first") == 0) { - opts->family_order = IPV4_FIRST; - } else if (strcasecmp(str_opt, "ipv4_only") == 0) { - opts->family_order = IPV4_ONLY; - } else if (strcasecmp(str_opt, "ipv6_first") == 0) { - opts->family_order = IPV6_FIRST; - } else if (strcasecmp(str_opt, "ipv6_only") == 0) { - opts->family_order = IPV6_ONLY; - } else { - DEBUG(1, ("Unknown value for option %s: %s\n", - CONFDB_DOMAIN_FAMILY_ORDER, str_opt)); - talloc_free(str_opt); - return EINVAL; - } - - talloc_free(str_opt); return EOK; } |