From b4744101f36021bf2dde713682abbd0cc6935168 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 1 Oct 2017 17:35:26 -0700 Subject: Hide internal __ifreq function [BZ #18822] Hide internal __ifreq function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/ifreq.h: New file. * sysdeps/generic/ifreq.h (__if_nextreq): Removed. (__ifreq): Likewise. * sysdeps/mach/hurd/ifreq.h (__if_nextreq): Removed. (__ifreq): Likewise. --- include/ifreq.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/ifreq.h (limited to 'include') diff --git a/include/ifreq.h b/include/ifreq.h new file mode 100644 index 0000000..94e984c --- /dev/null +++ b/include/ifreq.h @@ -0,0 +1,14 @@ +#include_next + +static inline struct ifreq * +__if_nextreq (struct ifreq *ifr) +{ +#ifdef _HAVE_SA_LEN + if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr) + return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len); +#endif + return ifr + 1; +} + +extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd) + attribute_hidden; -- cgit v1.1