Define missing __inet6_scopeid_pton internal function used by getaddrinfo
Commit Message
* posix/tst-rfc3484.c: Include <netinet/in.h> and <net/if.h>
(__inet6_scopeid_pton): New function.
Comments
Samuel Thibault, on jeu. 03 août 2017 02:23:52 +0200, wrote:
> * posix/tst-rfc3484.c: Include <netinet/in.h> and <net/if.h>
> (__inet6_scopeid_pton): New function.
And likewise for tst-rfc3484-2 and tst-rfc3484-3.
Samuel Thibault, on jeu. 03 août 2017 02:36:26 +0200, wrote:
> Samuel Thibault, on jeu. 03 août 2017 02:23:52 +0200, wrote:
> > * posix/tst-rfc3484.c: Include <netinet/in.h> and <net/if.h>
> > (__inet6_scopeid_pton): New function.
>
> And likewise for tst-rfc3484-2 and tst-rfc3484-3.
Err inet/tst-inet6_scopeid_pton.c also needs it, but how is this
supposed to link when __inet6_scopeid_pton is marked attribute_hidden?
Should it perhaps just
#include <ctype.h>
#define isdigit_l(c, locale) isdigit(c)
#define ____strtoull_l_internal(s, end, base, group, locale) strtoul(s, end, base)
#define __if_nametoindex if_nametoindex
#include "inet6_scopeid_pton.c"
?
Samuel
===================================================================
@@ -2,6 +2,8 @@
#include <stdio.h>
#include <ifaddrs.h>
#include <stdint.h>
+#include <netinet/in.h>
+#include <net/if.h>
/* Internal definitions used in the libc code. */
#define __getservbyname_r getservbyname_r
@@ -55,6 +57,15 @@ _res_hconf_init (void)
{
}
+int
+internal_function
+__inet6_scopeid_pton (const struct in6_addr *address, const char *scope,
+ uint32_t *result)
+{
+ *result = if_nametoindex(scope);
+ return 0;
+}
+
#undef USE_NSCD
#include "../sysdeps/posix/getaddrinfo.c"