ObjFW  Check-in [841dd6ddef]

Overview
Comment:Don't rely on inet6_getscopeid for KAME

OpenBSD uses KAME but doesn't have inet6_getscopeid.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 841dd6ddeffe346c2f46f3d493555b0befbfca18b59db9d4660b724b5db67c6c
User & Date: js on 2023-10-15 17:40:11
Other Links: manifest | tags
Context
2023-10-17
19:01
README.md: Add instructions for Windows with MSYS2 check-in: c15504a646 user: js tags: trunk
2023-10-15
17:40
Don't rely on inet6_getscopeid for KAME check-in: 703d77b0cb user: js tags: 1.0
17:40
Don't rely on inet6_getscopeid for KAME check-in: 841dd6ddef user: js tags: trunk
17:23
Fix +[OFSystemInfo networkInterfaces] on OpenBSD check-in: 87bd80a1d1 user: js tags: trunk
Changes

Modified configure.ac from [71e00505cc] to [e4de599d6e].

1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1468
1469
1470
1471
1472
1473
1474


1475
1476
1477
1478
1479
1480
1481







-
-







			#endif

			#ifdef AF_INET6
			egrep_cpp_yes
			#endif
		], [
			AC_DEFINE(OF_HAVE_IPV6, 1, [Whether we have IPv6])

			AC_CHECK_FUNCS(inet6_getscopeid)
		])
	], [
		dnl Work around a bug in autoconf 2.61 that creates a broken
		dnl configure if this branch is empty.
		:
	], [
		#ifdef _WIN32

Modified src/platform/POSIX/OFSystemInfo+NetworkInterfaces.m from [f0d0641f3a] to [a1d7049810].

223
224
225
226
227
228
229
230
231



232



233
234
235
236
237
238
239
223
224
225
226
227
228
229


230
231
232

233
234
235
236
237
238
239
240
241
242







-
-
+
+
+
-
+
+
+







			    sockaddrSize);

#  if defined(OF_HAVE_IPV6) && defined(HAVE_IF_NAMETOINDEX)
			if (address.sockaddr.in6.sin6_family == AF_INET6 &&
			    address.sockaddr.in6.sin6_addr.s6_addr[0] == 0xFE &&
			    (address.sockaddr.in6.sin6_addr.s6_addr[1] & 0xC0)
			    == 0x80) {
#   if defined(HAVE_INET6_GETSCOPEID)
				inet6_getscopeid(&address.sockaddr.in6,
#   if defined(__KAME__)
#    define addr6 address.sockaddr.in6.sin6_addr.s6_addr
				address.sockaddr.in6.sin6_scope_id =
				    INET6_IS_ADDR_LINKLOCAL);
				    (addr6[2] << 8) | addr6[3];
				addr6[2] = addr6[3] = 0;
#    undef addr6
#   elif defined(HAVE_IF_NAMETOINDEX)
				address.sockaddr.in6.sin6_scope_id =
				    if_nametoindex(
				    [name cStringWithEncoding: encoding]);
#   endif
			}
#  endif