[Bridge] Conflict between net/if.h and linux/if.h

Stephen Hemminger shemminger at linux-foundation.org
Mon Nov 26 09:01:54 PST 2007


I fixed the problem differently because I don't want more conditional
compilation.  The ideal fix would be to get glibc
to the headers fixed to be compatible.

 Use linux/if.h rather than net/if.h for compatiablity with
 other headers.

Signed-off-by: Stephen Hemminger <shemminger at linux-foundation.org>
---
 libbridge/libbridge.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
index 20d5bb5..016acea 100644
--- a/libbridge/libbridge.h
+++ b/libbridge/libbridge.h
@@ -19,9 +19,15 @@
 #ifndef _LIBBRIDGE_H
 #define _LIBBRIDGE_H
 
-#include <net/if.h>
+#include <sys/socket.h>
+#include <linux/if.h>
 #include <linux/if_bridge.h>
 
+/* defined in net/if.h but that conflicts with linux/if.h... */
+extern unsigned int if_nametoindex (const char *__ifname);
+extern char *if_indextoname (unsigned int __ifindex, char *__ifname);
+
+
 struct bridge_id
 {
 	unsigned char prio[2];
-- 
1.5.3.4



More information about the Bridge mailing list