]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- applied patch to support outgoing-interface with ub_ctx_set_option.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 26 Jan 2012 10:37:10 +0000 (10:37 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 26 Jan 2012 10:37:10 +0000 (10:37 +0000)
git-svn-id: file:///svn/unbound/trunk@2596 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/config_file.c

index 52f6b7f1c23a7789029321844ed12a6829fb5f37..edb34866caf824254a7a36d12cfa3a5396ec9160 100644 (file)
@@ -2,6 +2,7 @@
        - Tag 1.4.15 (same as 1.4.15rc1), for 1.4.15 release.
        - trunk 1.4.16; includes changes memset testcode, #424 openindiana,
          and keyfile write fixup.
+       - applied patch to support outgoing-interface with ub_ctx_set_option.
 
 23 January 2012: Wouter
        - Fix memset in test code.
index ae8e52b634464d34c30de7757e0d2dca975717e8..21d6d196590c34e1c1f4f9875b55030f5f5b5d17 100644 (file)
@@ -409,7 +409,18 @@ int config_set_option(struct config_file* cfg, const char* opt,
        else S_STR("control-cert-file:", control_cert_file)
        else S_STR("module-config:", module_conf)
        else S_STR("python-script:", python_script)
-       else {
+       else if (strcmp(opt, "outgoing-interface:") == 0) {
+               char* d = strdup(val);
+               char** oi = (char**)malloc((cfg->num_out_ifs+1)*sizeof(char*));
+               if(!d || !oi) { free(d); free(oi); return -1; }
+               if(cfg->out_ifs && cfg->num_out_ifs) {
+                       memmove(oi, cfg->out_ifs, cfg->num_out_ifs*sizeof(char*));
+                       free(cfg->out_ifs);
+               }
+               oi[cfg->num_out_ifs] = d;
+               cfg->num_out_ifs++;
+               cfg->out_ifs = oi;
+       } else {
                /* unknown or unsupported (from the set_option interface):
                 * interface, outgoing-interface, access-control, 
                 * stub-zone, name, stub-addr, stub-host, stub-prime