]> git.ozlabs.org Git - ppp.git/commitdiff
pppoe: include netinet/in.h before linux/in.h
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 9 Jan 2017 13:34:23 +0000 (13:34 +0000)
committerLubomir Rintel <lkundrak@v3.sk>
Mon, 9 Jan 2017 16:12:12 +0000 (17:12 +0100)
This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
included before <linux/in.h> otherwise the earlier, unaware of the latter,
tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't work
alone anymore, since it pulls the headers in the wrong order, so we better
include <netinet/in.h> early.

pppd/plugins/rp-pppoe/pppoe.h

index 9ab2eee3914c3718daa055375f32095beaa8a8f5..c4aaa6e68856e8506643a6c30c86177070af1fd7 100644 (file)
 #include <sys/socket.h>
 #endif
 
+/* This has to be included before Linux 4.8's linux/in.h
+ * gets dragged in. */
+#include <netinet/in.h>
+
 /* Ugly header files on some Linux boxes... */
 #if defined(HAVE_LINUX_IF_H)
 #include <linux/if.h>
@@ -84,8 +88,6 @@ typedef unsigned long UINT32_t;
 #include <linux/if_ether.h>
 #endif
 
-#include <netinet/in.h>
-
 #ifdef HAVE_NETINET_IF_ETHER_H
 #include <sys/types.h>
 
@@ -98,7 +100,6 @@ typedef unsigned long UINT32_t;
 #endif
 
 
-
 /* Ethernet frame types according to RFC 2516 */
 #define ETH_PPPOE_DISCOVERY 0x8863
 #define ETH_PPPOE_SESSION   0x8864