diff mbox

[ovs-dev,5/5] osx: Temporary compilation workarounds

Message ID 1457965819-9473-6-git-send-email-lrichard@redhat.com
State Superseded
Headers show

Commit Message

Lance Richardson March 14, 2016, 2:30 p.m. UTC
Base OS X does not implement a tap netdevice, stub out netdev-bsd.c
for OS X.

OS X rounding/padding rules for rtnetlink messages need to be
researched, for now force route_table_fallback_lookup() to return
failure on OS X systems.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
 lib/netdev-bsd.c | 2 ++
 lib/rtbsd.c      | 4 ++++
 2 files changed, 6 insertions(+)
diff mbox

Patch

diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
index edf04bf..72dca5f 100644
--- a/lib/netdev-bsd.c
+++ b/lib/netdev-bsd.c
@@ -15,6 +15,7 @@ 
  * limitations under the License.
  */
 
+#if !defined(__MACH__)
 #include <config.h>
 
 #include "netdev-provider.h"
@@ -1825,3 +1826,4 @@  af_link_ioctl(unsigned long command, const void *arg)
             : 0);
 }
 #endif
+#endif /* !defined(__MACH__) */
diff --git a/lib/rtbsd.c b/lib/rtbsd.c
index 33fb9fd..fe4c55c 100644
--- a/lib/rtbsd.c
+++ b/lib/rtbsd.c
@@ -128,7 +128,9 @@  rtbsd_notifier_run(void)
             case RTM_IFINFO:
             /* Since RTM_IFANNOUNCE messages are smaller than RTM_IFINFO
              * messages, the same buffer may be used. */
+#ifndef __MACH__ /* OS X does not implement RTM_IFANNOUNCE */
             case RTM_IFANNOUNCE:
+#endif
                 rtbsd_report_change(&msg);
                 break;
             default:
@@ -180,11 +182,13 @@  rtbsd_report_change(const struct if_msghdr *msg)
         change.if_index = msg->ifm_index;
         if_indextoname(msg->ifm_index, change.if_name);
         break;
+#ifndef __MACH__ /* OS X does not implement RTM_IFANNOUNCE */
     case RTM_IFANNOUNCE:
         ahdr = (const struct if_announcemsghdr *) msg;
         change.if_index = ahdr->ifan_index;
         strncpy(change.if_name, ahdr->ifan_name, IF_NAMESIZE);
         break;
+#endif
     }
 
     LIST_FOR_EACH (notifier, node, &all_notifiers) {