ObjFW  Check-in [703d77b0cb]

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 | 1.0
Files: files | file ages | folders
SHA3-256: 703d77b0cb4805bbaad5f6dcf2fcb6dc85b360e1499ed0093ee599d206a26aa1
User & Date: js on 2023-10-15 17:40:29
Other Links: branch diff | manifest | tags
Context
2023-10-19
20:26
Add PGP keys to the repo check-in: ee3557a09b user: js tags: 1.0
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: 006e494026 user: js tags: 1.0
Changes

Modified configure.ac from [f7f0966b8b] to [9252cb6573].

1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1463
1464
1465
1466
1467
1468
1469


1470
1471
1472
1473
1474
1475
1476







-
-







			#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