[dpdk-dev] [PATCH v2] examples/bond: fix bsd compile error

Ferruh Yigit ferruh.yigit at intel.com
Wed Nov 25 18:41:04 CET 2015


Error:
== bond
  CC main.o
/.../examples/bond/main.c:431:24: error: use of undeclared identifier 'AF_INET'
        if (res->ip.family == AF_INET)
                              ^
1 error generated.
/.../mk/internal/rte.compile-pre.mk:126: recipe for target 'main.o' failed

AF_INET defined in sys/socket.h

This header included for Linux:
. /<snip>/include/rte_ip.h
.. /usr/include/netinet/in.h
... /usr/include/sys/socket.h

But not for FreeBSD:
. /<snip>/include/rte_ip.h
.. /usr/include/netinet/in.h
... /usr/include/machine/endian.h
... /usr/include/netinet6/in6.h
. /<snip>/include/rte_tcp.h

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 examples/bond/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 4622283..19f4f05 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -45,6 +45,7 @@
 #include <termios.h>
 #include <unistd.h>
 #include <pthread.h>
+#include <sys/socket.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
-- 
2.5.0



More information about the dev mailing list