]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Gate setting of ipi_spec_dst on not building for freebsd
authorNeil Horman <nhorman@openssl.org>
Tue, 5 Mar 2024 15:56:35 +0000 (10:56 -0500)
committerNeil Horman <nhorman@openssl.org>
Thu, 7 Mar 2024 13:14:12 +0000 (08:14 -0500)
some variants of FreeBSD (notably Dells OneFS) implement IP_PKTINFO
partially, and as such the build breaks for those variants.
specifically, it supports IP_PKTINFO, but the in_pktinfo struct has no
defined ipi_spec_dst field.  Work around this by gating the setting of
that variable on not building for FreeBSD

Fixes #23739

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23753)

crypto/bio/bss_dgram.c

index 26549305ac1aaec49a20d31c2e14f22a23663858..c049883bf0a0d7e1baa67bdf305ac9476f16b0e7 100644 (file)
@@ -1174,7 +1174,7 @@ static int pack_local(BIO *b, MSGHDR_TYPE *mh, const BIO_ADDR *local) {
         cmsg->cmsg_type  = IP_PKTINFO;
 
         info = (struct in_pktinfo *)BIO_CMSG_DATA(cmsg);
-#   if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_CYGWIN)
+#   if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_CYGWIN) && !defined(__FreeBSD__)
         info->ipi_spec_dst      = local->s_in.sin_addr;
 #   endif
         info->ipi_addr.s_addr   = 0;