[libvirt] [PATCH] nwfilter: add a missing define, so libvirtd builds on macos x

The nwfilter code uses ETH_ALEN, which isn't defined on MacOS X. This is a simple workaround, to add it when missing. --- src/nwfilter/nwfilter_learnipaddr.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index 7c94fc2..554422b 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -38,6 +38,11 @@ #include <net/if_arp.h> #include <intprops.h> +// Add Linux define missing from OSX +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* Octets in one ethernet addr */ +#endif + #include "internal.h" #include "buf.h" -- 1.7.2.3

On 09/27/2010 07:45 AM, Justin Clift wrote:
The nwfilter code uses ETH_ALEN, which isn't defined on MacOS X. This is a simple workaround, to add it when missing. --- src/nwfilter/nwfilter_learnipaddr.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index 7c94fc2..554422b 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -38,6 +38,11 @@ #include<net/if_arp.h> #include<intprops.h>
+// Add Linux define missing from OSX +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* Octets in one ethernet addr */
ACK, except that you need to indent things or 'make syntax-check' will fail if you have cppi installed: # define ETH_ALEN 6
+#endif
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 09/28/2010 12:12 AM, Eric Blake wrote:
On 09/27/2010 07:45 AM, Justin Clift wrote: <snip>
+// Add Linux define missing from OSX +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* Octets in one ethernet addr */
ACK, except that you need to indent things or 'make syntax-check' will fail if you have cppi installed:
# define ETH_ALEN 6
Thanks Eric. Pushed it, with a space indent as indicated, after installing and checking with cppi (make syntax-check). :)

On 09/27/2010 09:45 AM, Justin Clift wrote:
The nwfilter code uses ETH_ALEN, which isn't defined on MacOS X. This is a simple workaround, to add it when missing.
Since the OSX network stack is based on *BSD, I'm assuming that iptables support isn't there anyway. When iptables isn't in, the nwfilter stuff shouldn't be included, so why is this even being compiled?
--- src/nwfilter/nwfilter_learnipaddr.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index 7c94fc2..554422b 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -38,6 +38,11 @@ #include<net/if_arp.h> #include<intprops.h>
+// Add Linux define missing from OSX +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* Octets in one ethernet addr */ +#endif + #include "internal.h"
#include "buf.h"
participants (3)
-
Eric Blake
-
Justin Clift
-
Laine Stump