summaryrefslogtreecommitdiff
path: root/lib/rtbsd.c
diff options
context:
space:
mode:
authorLance Richardson <lrichard@redhat.com>2016-03-15 11:52:58 -0400
committerBen Pfaff <blp@ovn.org>2016-03-22 18:42:58 -0700
commit97d0619c1174fe5bdc9cd40d6a8f2a2ffe3ba6ed (patch)
tree9e737f5eac19b93df72310afe9a407c897ebd62d /lib/rtbsd.c
parent8be8c95e8d0722607012756b8a711e93d9e4a3ab (diff)
downloadopenvswitch-97d0619c1174fe5bdc9cd40d6a8f2a2ffe3ba6ed.tar.gz
osx: handle differences between OS X and other BSDs
Conditional compilation to account for: - OS X does not implement RTM_IFANNOUNCE. - OS X does not implement tap netdeivces. - OS X does not implement RT_ROUNDUP(). Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/rtbsd.c')
-rw-r--r--lib/rtbsd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rtbsd.c b/lib/rtbsd.c
index 33fb9fdac..fe4c55c8f 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) {