<div dir="ltr">Hey Maria, Zhang,<div><br></div><div>Regarding CI/CD, perhaps I can have a chat with the folks of Flow who have exactly bare metal mac as a service including a tailored product for CI:</div><div><a href="https://flow.swiss/ci-engine" target="_blank">https://flow.swiss/ci-engine</a><br></div><div><br></div><div>If the expected lifetime of macOS support in Bird is unknown, and there is no vested interest in it, perhaps that would be less of an appealing situation.<br></div><div><div>It kind of depends on the eventual use / longevity. If folks on this list are enthusiastic about macOS, and the maintainers are OK extending the builds to include it, I think it would definitely be possible to work with the flow.swiss team, and I can make introductions.</div><br class="gmail-Apple-interchange-newline"></div><div>groet,</div><div>Pim</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2024 at 11:22 AM Maria Matejka via Bird-users <<a href="mailto:bird-users@network.cz">bird-users@network.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p><font face="Gentium">Hello Zhang,</font></p>
<p><font face="Gentium">thank you for your contribution. This looks
includable, however I'd like to ask you about maintainability of
this patch. It may quite quickly rot away. Is there an easy (and
legal) way to have automatic macOS build and basic run testing,
without a need to maintain a physical Mac?<br>
</font></p>
<p><font face="Gentium">Thanks,<br>
Maria<br>
</font></p>
<div>On 2024-03-13 03:02, Zhang Maiyun via
Bird-users wrote:<br>
</div>
<blockquote type="cite">
<pre>Dear all,
This patch makes bird build and run on macOS with `sysconfig=bsd`.
It is mainly modifying preprocessor directives.
I have tested it on macOS 14.3.1 and it is able to establish BGP sessions
and at least exchange IPv4 routes.
Kind regards,
Maiyun Zhang
Signed-off-by: Zhang Maiyun <a href="mailto:me@maiyun.me" target="_blank"><me@maiyun.me></a>
---
sysdep/bsd/krt-sock.c | 6 ++++++
sysdep/bsd/sysio.h | 6 +++++-
sysdep/unix/io.c | 3 +++
sysdep/unix/random.c | 2 +-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index d13e20a3..afb66cb3 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -635,6 +635,7 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
krt_got_route_async(p, e, new, src);
}
+#ifndef __APPLE__
static void
krt_read_ifannounce(struct ks_msg *msg)
{
@@ -661,6 +662,7 @@ krt_read_ifannounce(struct ks_msg *msg)
DBG("KRT: IFANNOUNCE what: %d index %d name %s\n", ifam->ifan_what, ifam->ifan_index, ifam->ifan_name);
}
+#endif
static void
krt_read_ifinfo(struct ks_msg *msg, int scan)
@@ -725,7 +727,9 @@ krt_read_ifinfo(struct ks_msg *msg, int scan)
if (fl & IFF_UP)
f.flags |= IF_ADMIN_UP;
+#ifndef __APPLE__
if (ifm->ifm_data.ifi_link_state != LINK_STATE_DOWN)
+#endif
f.flags |= IF_LINK_UP; /* up or unknown */
if (fl & IFF_LOOPBACK) /* Loopback */
f.flags |= IF_MULTIACCESS | IF_LOOPBACK | IF_IGNORE;
@@ -873,9 +877,11 @@ krt_read_msg(struct proto *p, struct ks_msg *msg, int scan)
case RTM_CHANGE:
krt_read_route(msg, (struct krt_proto *)p, scan);
break;
+#ifndef __APPLE__
case RTM_IFANNOUNCE:
krt_read_ifannounce(msg);
break;
+#endif
case RTM_IFINFO:
krt_read_ifinfo(msg, scan);
break;
diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h
index b6b42b1e..85081c07 100644
--- a/sysdep/bsd/sysio.h
+++ b/sysdep/bsd/sysio.h
@@ -32,7 +32,7 @@
#endif
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__APPLE__)
#ifndef IP_RECVTTL
#define IP_RECVTTL 23
@@ -49,6 +49,10 @@
#define TCP_MD5SIG TCP_SIGNATURE_ENABLE
#endif
+#ifdef __APPLE__
+#define TCP_MD5SIG TCPOPT_SIGNATURE
+#endif
+
#undef SA_LEN
#define SA_LEN(x) (x).sa.sa_len
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 9b499020..81e09888 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -12,6 +12,9 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#ifdef __APPLE__
+#define __APPLE_USE_RFC_3542
+#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdep/unix/random.c b/sysdep/unix/random.c
index 4e64e56b..7d68c482 100644
--- a/sysdep/unix/random.c
+++ b/sysdep/unix/random.c
@@ -16,7 +16,7 @@
#include "sysdep/config.h"
#include "nest/bird.h"
-#ifdef HAVE_GETRANDOM
+#if defined(HAVE_GETRANDOM) || (defined(__APPLE__) && defined(HAVE_GETENTROPY))
#include <sys/random.h>
#endif
</pre>
</blockquote>
<pre cols="72">--
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.</pre>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Pim van Pelt <<a href="mailto:pim@ipng.nl" target="_blank">pim@ipng.nl</a>> <br>PBVP1-RIPE - <a href="http://www.ipng.nl/" target="_blank">http://www.ipng.nl/</a></div>