knot 3.3.3 failed to build on macos
error build log
knot/server/quic-handler.c:151:25: error: use of undeclared identifier 'IPV6_PKTINFO'
cmsg.cmsg.cmsg_type = IPV6_PKTINFO;
^
1 error generated.
And this is the working patch:
diff --git a/src/knot/server/quic-handler.c b/src/knot/server/quic-handler.c
index 0944900..f8ab263 100644
--- a/src/knot/server/quic-handler.c
+++ b/src/knot/server/quic-handler.c
@@ -13,6 +13,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#ifdef __APPLE__
+#define __APPLE_USE_RFC_3542 /* to use IPV6_PKTINFO */
+#endif
#include <netinet/in.h>
#include <string.h>
diff --git a/src/knot/server/udp-handler.c b/src/knot/server/udp-handler.c
index 3b06fa9..5d85877 100644
--- a/src/knot/server/udp-handler.c
+++ b/src/knot/server/udp-handler.c
@@ -14,7 +14,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#define __APPLE_USE_RFC_3542
+#ifdef __APPLE__
+#define __APPLE_USE_RFC_3542 /* to use IPV6_PKTINFO */
+#endif
#include <assert.h>
#include <dlfcn.h>
relates to https://github.com/Homebrew/homebrew-core/pull/157149