Skip to content

Commit

Permalink
aix: disable ipv6 link local
Browse files Browse the repository at this point in the history
aix does not implement ifaddrs and when retrieving the network
interfaces with uv_interface_addresses there was a test failure in
tcp_connect6_link_local.

Ref: libuv#4222 (comment)

For now disable ipv6 link local on aix to:

1) fix broken aix build
2) stop blocking libuv upgrade in node
   Ref: nodejs/node#50650
  • Loading branch information
abmusse committed Nov 17, 2023
1 parent 6be130e commit 66ecc0d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/unix/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@
#include <sys/types.h>
#include <sys/socket.h>

#if defined(__PASE__)
#include <as400_protos.h>
#define ifaddrs ifaddrs_pase
#define getifaddrs Qp2getifaddrs
#define freeifaddrs Qp2freeifaddrs
#else
// ifaddrs is not implemented on AIX
#if !defined(_AIX)
#include <ifaddrs.h>
#endif

Expand Down Expand Up @@ -210,6 +206,10 @@ int uv__tcp_bind(uv_tcp_t* tcp,


static int uv__is_ipv6_link_local(const struct sockaddr* addr) {
// disable link local on AIX & PASE for now
#if defined(_AIX)
return 0;
#else
const struct sockaddr_in6* a6;
uint8_t b[2];

Expand All @@ -220,10 +220,15 @@ static int uv__is_ipv6_link_local(const struct sockaddr* addr) {
memcpy(b, &a6->sin6_addr, sizeof(b));

return b[0] == 0xFE && b[1] == 0x80;
#endif
}


static int uv__ipv6_link_local_scope_id(void) {
// disable link local on AIX & PASE for now
#if defined(_AIX)
return 0;
#else
struct sockaddr_in6* a6;
struct ifaddrs* ifa;
struct ifaddrs* p;
Expand All @@ -245,6 +250,7 @@ static int uv__ipv6_link_local_scope_id(void) {

freeifaddrs(ifa);
return rv;
#endif
}


Expand Down

0 comments on commit 66ecc0d

Please sign in to comment.