From 3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 31 Oct 2011 01:51:16 -0400 Subject: 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. --- ChangeLog | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index b4e65a847c..005a1b7ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2011-10-31 Ulrich Drepper + + * include/ifaddrs.h: Declare __free_in6ai and __bump_nl_timestamp. + * inet/check_pf.c: Provide dummy versions of __free_in6ai and + __bump_nl_timestamp. + * nscd/connections (nscd_init): When host database is served open + netlink socket and request notification about configuration changes. + (main_loop_poll): Track netlink file descriptor and bump timestamp + in case data becomes available. + (main_loop_epoll): Likewise. + * nscd/nscd-client.h (DB_VERSION): Bump to 2. + (database_pers_head): Add extra_data fileds. + Declare __nscd_get_mapping and __nscd_get_nl_timestamp. + * nscd/nscd_gethst_r.c (__nscd_get_nl_timestamp): New function. + * nscd/nscd_helper.c (__nscd_get_mapping): Renamed from get_mapping. + Adjust caller. + * sysdeps/posix/getaddrinfo.c (getaddrinfo): Don't call free on + in6ai data, call __free_in6ai. + * sysdeps/unix/sysv/linux/Makefile [subdir=nscd] (sysdep-CFLAGS): + Add -DHAVE_NETLINK. + * sysdeps/unix/sysv/linux/check_pf.c: Major rewrite. Cache the + interface information. Reuse previous data if netlink timestamp + is not changed. + (__bump_nl_timestamp): New function. + (__free_in6ai): New function. + 2011-10-30 Ulrich Drepper * sysdeps/unix/sysv/linux/check_pf.c (make_request): Don't call -- cgit v1.2.3