about summary refs log tree commit diff
path: root/resolv/res-close.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-07-03 20:31:23 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-07-03 20:57:28 +0200
commitf30a54b21b83f254533c59ca72ad17af5249c6be (patch)
tree174c6e8b77d8fc1514f4108e3290b91d19d838a6 /resolv/res-close.c
parent352f4ff9a268b81ef5d4b2413f582565806e4790 (diff)
downloadglibc-f30a54b21b83f254533c59ca72ad17af5249c6be.tar.gz
glibc-f30a54b21b83f254533c59ca72ad17af5249c6be.tar.xz
glibc-f30a54b21b83f254533c59ca72ad17af5249c6be.zip
resolv: Introduce struct resolv_conf with extended resolver state
This change provides additional resolver configuration state which
is not exposed through the _res ABI.  It reuses the existing
initstamp field in the supposedly-private part of _res.  Some effort
is undertaken to avoid memory safety issues introduced by applications
which directly patch the _res object.

With this commit, only the initstamp field is moved into struct
resolv_conf.  Additional members will be added later, eventually
migrating the entire resolver configuration.
Diffstat (limited to 'resolv/res-close.c')
-rw-r--r--resolv/res-close.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/resolv/res-close.c b/resolv/res-close.c
index 97da73c99c..21f038c2c7 100644
--- a/resolv/res-close.c
+++ b/resolv/res-close.c
@@ -84,6 +84,7 @@
 
 #include <resolv-internal.h>
 #include <resolv_context.h>
+#include <resolv_conf.h>
 #include <not-cancel.h>
 
 /* Close all open sockets.  If FREE_ADDR is true, deallocate any
@@ -111,6 +112,8 @@ __res_iclose (res_state statp, bool free_addr)
             statp->_u._ext.nsaddrs[ns] = NULL;
           }
       }
+  if (free_addr)
+    __resolv_conf_detach (statp);
 }
 libc_hidden_def (__res_iclose)