summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa/ipa_dyndns.c
diff options
context:
space:
mode:
authorJames Hogarth <james.hogarth@gmail.com>2012-08-14 10:54:34 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-10-16 13:23:51 +0200
commit4fb12db7504920d12ea7db71f312334c877bff7c (patch)
tree329d9f302242dbecb7c31835350d88bc5531f0a4 /src/providers/ipa/ipa_dyndns.c
parentf2c39d4869da56268726f6e8fc224de8cecb7336 (diff)
downloadsssd-4fb12db7504920d12ea7db71f312334c877bff7c.tar.gz
sssd-4fb12db7504920d12ea7db71f312334c877bff7c.tar.xz
sssd-4fb12db7504920d12ea7db71f312334c877bff7c.zip
Make TTL configurable for dynamic dns updates
Diffstat (limited to 'src/providers/ipa/ipa_dyndns.c')
-rw-r--r--src/providers/ipa/ipa_dyndns.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c
index 66515e840..3f430a337 100644
--- a/src/providers/ipa/ipa_dyndns.c
+++ b/src/providers/ipa/ipa_dyndns.c
@@ -857,7 +857,7 @@ static int create_nsupdate_message(struct ipa_nsupdate_ctx *ctx,
uint8_t remove_af,
bool use_server_with_nsupdate)
{
- int ret, i;
+ int ret, i, ttl;
char *servername = NULL;
char *realm;
char *realm_directive;
@@ -935,6 +935,15 @@ static int create_nsupdate_message(struct ipa_nsupdate_ctx *ctx,
goto done;
}
+ /* Get the TTL details for the record(s) */
+
+ ttl = dp_opt_get_int(ctx->dyndns_ctx->ipa_ctx->basic,
+ IPA_DYNDNS_TTL);
+ /* Should not happen but just in case set the default */
+ if (!ttl) {
+ ttl = 1200;
+ }
+
/* Remove existing entries as needed */
if (remove_af & IPA_DYNDNS_REMOVE_A) {
ctx->update_msg = talloc_asprintf_append(ctx->update_msg,
@@ -986,8 +995,9 @@ static int create_nsupdate_message(struct ipa_nsupdate_ctx *ctx,
/* Format the record update */
ctx->update_msg = talloc_asprintf_append(
ctx->update_msg,
- "update add %s. 86400 in %s %s\n",
+ "update add %s. %d in %s %s\n",
ctx->dyndns_ctx->hostname,
+ ttl,
new_record->addr->ss_family == AF_INET ? "A" : "AAAA",
ip_addr);
if (ctx->update_msg == NULL) {