GNS3 / iouyap

Bridge IOU to UDP, TAP and Ethernet.
GNU General Public License v3.0
23 stars 10 forks source link

iouyap.c:743:41: error: 'IFF_MULTI_QUEUE' undeclared (first use in this function) #3

Closed anubisg1 closed 10 years ago

anubisg1 commented 10 years ago

after commit 1c7c6686ba78539f726630c59033449ac1efa4ac While compiling iouyap, on some systems (for example opensuse 12.3) IFF_MULTI_QUEUE is not supported. this cause to fail to compile iouyap

[   32s] + cd iouyap-0.1
[   32s] + bison --yacc -dv netmap_parse.y
[   32s] + flex netmap_scan.l
[   32s] + gcc -Wall -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g config.c iouyap.c lex.yy.c netmap.c y.tab.c -o iouyap -liniparser -lpthread
[   32s] iouyap.c: In function 'open_span_dev':
[   32s] iouyap.c:743:41: error: 'IFF_MULTI_QUEUE' undeclared (first use in this function)
[   32s] iouyap.c:743:41: note: each undeclared identifier is reported only once for each function it appears in
[   32s] iouyap.c: In function 'main':
[   32s] iouyap.c:1451:17: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result [-Wunused-result]
[   32s] iouyap.c: In function 'lock_socket':
[   32s] iouyap.c:180:13: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result]
[   32s] iouyap.c: In function 'open_pcap_file':
[   32s] iouyap.c:794:23: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result]
[   33s] iouyap.c: In function 'foreign_listener':
[   33s] iouyap.c:421:15: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
[   33s] iouyap.c: In function 'iou_listener':
[   33s] iouyap.c:548:15: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
[   33s] error: Bad exit status from /var/tmp/rpm-tmp.kRqCuw (%build)
anubisg1 commented 10 years ago

this patch fixes the problem:

diff -uNr old-iouyap-0.1/iouyap.h iouyap-0.1/iouyap.h
--- old-iouyap-0.1/iouyap.h     2014-06-15 19:36:29.433213973 +0200
+++ iouyap-0.1/iouyap.h 2014-06-15 19:37:57.551611109 +0200
@@ -89,6 +89,11 @@
 #define UNIX_PATH_MAX sizeof(sizecheck.sun_path)
 #endif

+/* Not everyone has IFF_MULTI_QUEUE */
+#ifndef IFF_MULTI_QUEUE
+#define IFF_MULTI_QUEUE 0x0100
+#endif
+
 /* Logging levels */
 enum {LOG_QUIET, LOG_BASIC, LOG_EXTENDED, LOG_NOISY, LOG_CRAZY};