]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Define ioctl for VLAN and bond.
authorVincent Bernat <bernat@luffy.cx>
Wed, 30 Sep 2009 00:42:06 +0000 (02:42 +0200)
committerVincent Bernat <bernat@luffy.cx>
Wed, 30 Sep 2009 01:44:38 +0000 (03:44 +0200)
We also give some kind of advice for people without if_vlan.h or with
an outdated if_bonding.h (for example, people with RHEL 2.1).

README
configure.ac
src/compat.h

diff --git a/README b/README
index 971f36856f7c67b88f821b1085b2e14bfd0fed38..bdbec4d91ddd7907a6018dac62bf142368d15e8d 100644 (file)
--- a/README
+++ b/README
@@ -30,6 +30,16 @@ Net-SNMP is incomplete. The easiest way to fix this is to provide an
 empty struct.h:
  touch src/struct.h
 
+If you are missing some headers or if some headers are incorrect
+(if_vlan.h and if_bonding.h on RHEL 2.1 for example), you can copy
+some more current version (for example from Debian Lenny or from
+Fedora) in some directory like "extra-headers/":
+ - ./extra-headers/linux/if_vlan.h
+ - ./extra-headers/linux/if_bonding.h
+Then, configure like this:
+ ./configure CFLAGS="-Wall -I${PWD}/extra-headers"
+This has been tested with RHEL 2.1.
+
 lldpd uses privilege separation to increase its security. Two
 processes, one running as root and doing minimal stuff and the other
 running as an unprivileged user into a chroot doing most of the stuff,
index b373769b8a7f0937dfbc41b998471a73c327677d..7156941526ae0d0edfbb5f9612b97cfc0e0755a9 100644 (file)
@@ -59,7 +59,6 @@ AC_CHECK_HEADERS([ \
 AC_CHECK_HEADERS([ \
   linux/wireless.h \
   linux/if_bonding.h \
-  linux/if_vlan.h \
   linux/if_bridge.h \
   linux/if_packet.h \
 ],,AC_MSG_ERROR([Required header missing.]),[
@@ -71,6 +70,12 @@ AC_CHECK_HEADERS([ \
 ],,AC_MSG_ERROR([Required header missing.]),[
 @%:@include <linux/types.h>
 ])
+AC_CHECK_HEADERS([ \
+  linux/if_vlan.h \
+],,AC_MSG_ERROR([You should get linux/if_vlan.h from some other place. See README file.]),[
+@%:@include <arpa/inet.h>
+@%:@include <linux/if.h>
+])
 
 AC_CACHE_SAVE
 
@@ -90,6 +95,20 @@ SLIST_REMOVE_HEAD, \
 SLIST_EMPTY \
 ],[],[],[[@%:@include <sys/queue.h>]])
 
+# On some systems, some ioctl are not declared
+AC_CHECK_DECLS([ \
+SIOCGIFVLAN, \
+SIOCBONDINFOQUERY, \
+SIOCBONDSLAVEINFOQUERY \
+],[],[],[[@%:@include <linux/sockios.h>]])
+AC_CHECK_MEMBERS([ifslave.slave_name, ifbond.num_slaves], [],
+   [AC_MSG_ERROR([linux/if_bonding.h is incomplete. See README file.])],
+   [
+@%:@include <arpa/inet.h>
+@%:@include <linux/if.h>
+@%:@include <linux/if_bonding.h>
+])
+
 # Do we have PACKET_ORIGDEV (it can be present at runtime, put it in compat.h)
 AC_CHECK_DECLS([PACKET_ORIGDEV],[],[],[[@%:@include <linux/if_packet.h>]])
 
index 3f5823de97698f423a25effb0a5c5b43a4989d46..f05b6a513b497a33f176222c2dd156bed5b7fd8e 100644 (file)
@@ -93,6 +93,18 @@ struct {                                                             \
 #define        SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
 #endif
 
+#if !HAVE_SIOCGIFVLAN
+#define SIOCGIFVLAN 0x8982
+#endif
+
+#if !HAVE_SIOCBONDINFOQUERY
+#define SIOCBONDINFOQUERY 0x8994
+#endif
+
+#if !HAVE_SIOCBONDSLAVEINFOQUERY
+#define SIOCBONDSLAVEINFOQUERY 0x8993
+#endif
+
 #if !HAVE_DECL_SPEED_10000
 #define SPEED_10000 10000
 #endif