]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Fixed unsupported vlan tag build issue
authorThomas Markwalder <tmark@isc.org>
Fri, 20 Feb 2015 18:21:37 +0000 (13:21 -0500)
committerThomas Markwalder <tmark@isc.org>
Fri, 20 Feb 2015 18:21:37 +0000 (13:21 -0500)
    Merges in rt38677

RELNOTES
common/lpf.c
configure
configure.ac
includes/config.h.in

index 6aa9460c95f32d5526bc05109b3e3417f0ac80f4..0aed7074e5d4f40a2e05d36dea95aa2c40eb4930 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -52,6 +52,14 @@ ISC DHCP is open source software maintained by Internet Systems
 Consortium.  This product includes cryptographic software written
 by Eric Young (eay@cryptsoft.com).
 
+                       Changes since 4.3.2c1
+
+- Corrected a compilation error introduced by the fix for ISC-Bugs #37415.
+  The error occurs on Linux variants that do not support VLAN tag information
+  in packet auxiliary data.  The configure script now only enables inclusion
+  of the VLAN tag-based logic if it is supported by the underlying OS.
+  [ISC-Bugs #38677]
+
                        Changes since 4.3.2b1
 
 - Specifying the option, --disable-debug, on the configure script command line
index 37cb99eb6cfcc19862fc6455e4376d1c4f71b359..cd430dd765cba9adba702e9bc1913725a6ffd27d 100644 (file)
@@ -398,7 +398,8 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
         *  NICs perform VLAN encapsulation, while drivers for PCnet series
         *  do not, for example. The linux kernel makes stripped vlan info
         *  visible to user space via CMSG/auxdata, this appears to not be
-        *  true for BSD OSs.)
+        *  true for BSD OSs.).  NOTE: this is only supported on linux flavors
+        *  which define the tpacket_auxdata.tp_vlan_tci.
         *
         *  b. Determine if checksum is valid for use. It may not be if
         *  checksum offloading is enabled on the interface.  */
@@ -409,8 +410,11 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
                    cmsg->cmsg_type == PACKET_AUXDATA) {
                        struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg);
                        /* Discard packets with stripped vlan id */
+
+#ifdef VLAN_TCI_PRESENT
                        if (aux->tp_vlan_tci != 0)
                                return 0;
+#endif
 
                        csum_ready = ((aux->tp_status & TP_STATUS_CSUMNOTREADY)
                                      ? 0 : 1);
index db9eada516c90a3112c01afd7acd7fe83f4a7d30..2f2a2c5053875b8e31e6ff1f0b863e086245834d 100755 (executable)
--- a/configure
+++ b/configure
@@ -6570,6 +6570,16 @@ fi
 fi
 
 
+ac_fn_c_check_member "$LINENO" "struct tpacket_auxdata" "tp_vlan_tci" "ac_cv_member_struct_tpacket_auxdata_tp_vlan_tci" "#include <linux/if_packet.h>
+"
+if test "x$ac_cv_member_struct_tpacket_auxdata_tp_vlan_tci" = xyes; then :
+
+$as_echo "#define VLAN_TCI_PRESENT 1" >>confdefs.h
+
+
+fi
+
+
 libbind=
 
 # Check whether --with-libbind was given.
index e569f157f3d000d7110ad54fab3b6666eb9a1f41..ead0bc7740d47a75566af7a331c93c25c42f8a56 100644 (file)
@@ -576,6 +576,10 @@ AC_CHECK_MEMBER(struct msghdr.msg_control,,
 #include <sys/socket.h>
        ])
 
+AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
+    [AC_DEFINE([VLAN_TCI_PRESENT], [1], [tpacket_auxdata.tp_vlan_tci present])]
+    ,, [#include <linux/if_packet.h>])
+
 libbind=
 AC_ARG_WITH(libbind,
        AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH 
index 6d07e9f06adf70973c56eae2ab5d1a71472c0ab6..8c17338547a827b6330bac549f47216354ed40e4 100644 (file)
 /* Version number of package */
 #undef VERSION
 
+/* tpacket_auxdata.tp_vlan_tci present */
+#undef VLAN_TCI_PRESENT
+
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD