hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition
from `freeaddrinfo'. `getifaddrs' and `freeifaddrs' are not in POSIX, they should not be exposed along `freeaddrinfo' (through `__check_pf') which is POSIX. * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations, and use libc_hidden_def on them. * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on them. * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise. * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs instead of getifaddrs and freeifaddrs.
This commit is contained in:
parent
64a4af28a6
commit
4009ddc692
|
@ -17,6 +17,13 @@
|
||||||
redefine as weak alias.
|
redefine as weak alias.
|
||||||
* sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead
|
* sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead
|
||||||
of seekdir.
|
of seekdir.
|
||||||
|
* include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations,
|
||||||
|
and use libc_hidden_def on them.
|
||||||
|
* inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on
|
||||||
|
them.
|
||||||
|
* sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise.
|
||||||
|
* inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs
|
||||||
|
instead of getifaddrs and freeifaddrs.
|
||||||
|
|
||||||
2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
|
2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
libc_hidden_proto (getifaddrs)
|
libc_hidden_proto (getifaddrs)
|
||||||
libc_hidden_proto (freeifaddrs)
|
libc_hidden_proto (freeifaddrs)
|
||||||
|
|
||||||
|
extern int __getifaddrs (struct ifaddrs **__ifap);
|
||||||
|
libc_hidden_proto (__getifaddrs)
|
||||||
|
extern void __freeifaddrs (struct ifaddrs *__ifa);
|
||||||
|
libc_hidden_proto (__freeifaddrs)
|
||||||
|
|
||||||
struct in6addrinfo
|
struct in6addrinfo
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -32,7 +32,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
|
||||||
|
|
||||||
/* Get the interface list via getifaddrs. */
|
/* Get the interface list via getifaddrs. */
|
||||||
struct ifaddrs *ifa = NULL;
|
struct ifaddrs *ifa = NULL;
|
||||||
if (getifaddrs (&ifa) != 0)
|
if (__getifaddrs (&ifa) != 0)
|
||||||
{
|
{
|
||||||
/* We cannot determine what interfaces are available. Be
|
/* We cannot determine what interfaces are available. Be
|
||||||
pessimistic. */
|
pessimistic. */
|
||||||
|
@ -51,7 +51,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
|
||||||
else if (runp->ifa_addr->sa_family == PF_INET6)
|
else if (runp->ifa_addr->sa_family == PF_INET6)
|
||||||
*seen_ipv6 = true;
|
*seen_ipv6 = true;
|
||||||
|
|
||||||
(void) freeifaddrs (ifa);
|
(void) __freeifaddrs (ifa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ __getifaddrs (struct ifaddrs **ifap)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
weak_alias (__getifaddrs, getifaddrs)
|
weak_alias (__getifaddrs, getifaddrs)
|
||||||
|
libc_hidden_def (__getifaddrs)
|
||||||
libc_hidden_weak (getifaddrs)
|
libc_hidden_weak (getifaddrs)
|
||||||
stub_warning (getifaddrs)
|
stub_warning (getifaddrs)
|
||||||
|
|
||||||
|
@ -43,5 +44,6 @@ __freeifaddrs (struct ifaddrs *ifa)
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
weak_alias (__freeifaddrs, freeifaddrs)
|
weak_alias (__freeifaddrs, freeifaddrs)
|
||||||
|
libc_hidden_def (__freeifaddrs)
|
||||||
libc_hidden_weak (freeifaddrs)
|
libc_hidden_weak (freeifaddrs)
|
||||||
stub_warning (freeifaddrs)
|
stub_warning (freeifaddrs)
|
||||||
|
|
|
@ -151,6 +151,7 @@ __getifaddrs (struct ifaddrs **ifap)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
weak_alias (__getifaddrs, getifaddrs)
|
weak_alias (__getifaddrs, getifaddrs)
|
||||||
|
libc_hidden_def (__getifaddrs)
|
||||||
#ifndef getifaddrs
|
#ifndef getifaddrs
|
||||||
libc_hidden_weak (getifaddrs)
|
libc_hidden_weak (getifaddrs)
|
||||||
#endif
|
#endif
|
||||||
|
@ -161,4 +162,5 @@ __freeifaddrs (struct ifaddrs *ifa)
|
||||||
free (ifa);
|
free (ifa);
|
||||||
}
|
}
|
||||||
weak_alias (__freeifaddrs, freeifaddrs)
|
weak_alias (__freeifaddrs, freeifaddrs)
|
||||||
|
libc_hidden_def (__freeifaddrs)
|
||||||
libc_hidden_weak (freeifaddrs)
|
libc_hidden_weak (freeifaddrs)
|
||||||
|
|
Loading…
Reference in New Issue