2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

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>
This commit is contained in:
Lance Richardson
2016-03-15 11:52:58 -04:00
committed by Ben Pfaff
parent 8be8c95e8d
commit 97d0619c11
3 changed files with 13 additions and 0 deletions

View File

@@ -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) {