Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 1 | From 36c74f974eba6f276ed4dd04c2077e6f23ebec37 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 17 Oct 2021 16:09:03 -0700 |
| 4 | Subject: [PATCH] netconfig: Use s6_addr instead of __in6_u.__u6_addr8 |
| 5 | |
| 6 | Building fails with: |
| 7 | |
| 8 | ../iwd-1.18/src/netconfig.c: In function 'netconfig_ipv6_to_string': |
| 9 | ../iwd-1.18/src/netconfig.c:188:25: error: 'struct in6_addr' has no member named '__in6_u'; did you mean '__in6_union'? |
| 10 | 188 | memcpy(in6_addr.__in6_u.__u6_addr8, addr, 16); |
| 11 | | ^~~~~~~ |
| 12 | | __in6_union |
| 13 | |
| 14 | Can be fixed by changing &this_ip.__in6_u.__u6_addr8[0] with &this_ip.s6_addr[0]. |
| 15 | For references: in6_addr is declared in /usr/include/linux/in6.h |
| 16 | |
| 17 | Upstream-Status: Pending |
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 19 | --- |
| 20 | src/netconfig.c | 2 +- |
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 22 | |
| 23 | diff --git a/src/netconfig.c b/src/netconfig.c |
| 24 | index c748630..ab51c3d 100644 |
| 25 | --- a/src/netconfig.c |
| 26 | +++ b/src/netconfig.c |
| 27 | @@ -185,7 +185,7 @@ static inline char *netconfig_ipv6_to_string(const uint8_t *addr) |
| 28 | struct in6_addr in6_addr; |
| 29 | char *addr_str = l_malloc(INET6_ADDRSTRLEN); |
| 30 | |
| 31 | - memcpy(in6_addr.__in6_u.__u6_addr8, addr, 16); |
| 32 | + memcpy(in6_addr.s6_addr, addr, 16); |
| 33 | |
| 34 | if (L_WARN_ON(unlikely(!inet_ntop(AF_INET6, &in6_addr, addr_str, |
| 35 | INET6_ADDRSTRLEN)))) { |
| 36 | -- |
| 37 | 2.33.1 |
| 38 | |