diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-31 01:51:16 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-31 01:51:16 -0400 |
commit | 3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6 (patch) | |
tree | de7827ff96076cb4d181ed781c418601906fa772 /nscd/nscd_helper.c | |
parent | 636064eb4c03397c86aa26e489e68f952bd5e53f (diff) | |
download | glibc-3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6.zip glibc-3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6.tar.gz glibc-3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6.tar.bz2 |
Cache network interface information
Whenever getaddrinfo needed network interface information it used the
netlink interface to read the information every single time. The
problem is that this information can change at any time.
The patch implements monitoring of the network interfaces through
nscd. If no change is detected the previously read information can
be reused (which is the norm). This timestamp information is also
made available to other processes using the shared memory segment
between nscd and those processes.
Diffstat (limited to 'nscd/nscd_helper.c')
-rw-r--r-- | nscd/nscd_helper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c index fe63f9a..365b599 100644 --- a/nscd/nscd_helper.c +++ b/nscd/nscd_helper.c @@ -277,9 +277,9 @@ __nscd_unmap (struct mapped_database *mapped) /* Try to get a file descriptor for the shared meory segment containing the database. */ -static struct mapped_database * -get_mapping (request_type type, const char *key, - struct mapped_database **mappedp) +struct mapped_database * +__nscd_get_mapping (request_type type, const char *key, + struct mapped_database **mappedp) { struct mapped_database *result = NO_MAPPING; #ifdef SCM_RIGHTS @@ -449,8 +449,8 @@ __nscd_get_map_ref (request_type type, const char *name, || (cur->head->nscd_certainly_running == 0 && cur->head->timestamp + MAPPING_TIMEOUT < time (NULL)) || cur->head->data_size > cur->datasize) - cur = get_mapping (type, name, - (struct mapped_database **) &mapptr->mapped); + cur = __nscd_get_mapping (type, name, + (struct mapped_database **) &mapptr->mapped); if (__builtin_expect (cur != NO_MAPPING, 1)) { |