1From a85ca79143a87286f793957e803ee3daf03c2b57 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Tue, 6 Jul 2021 14:06:44 -0700 4Subject: [PATCH] layer4: Change order of include files 5 6curent order to include standard headers first is causing an isue with 7glibc 2.34 + kernel-headers 5.13+ where order of including netinet/in.h 8and linux/in.h matters and it does not define __UAPI_DEF_IN_IPPROTO 9before including linux/in.h and then later includes netinet/in.h which 10then means lot of definitions will be defined twice and compile would 11fail. Re-ordering the local headers to appear first solves the issue 12amicably, and I think this is right order too 13 14Upsteam-Status: Pending 15Signed-off-by: Khem Raj <raj.khem@gmail.com> 16--- 17 keepalived/core/layer4.c | 21 ++++++++++----------- 18 1 file changed, 10 insertions(+), 11 deletions(-) 19 20diff --git a/keepalived/core/layer4.c b/keepalived/core/layer4.c 21index 90cdc84..c122c29 100644 22--- a/keepalived/core/layer4.c 23+++ b/keepalived/core/layer4.c 24@@ -23,6 +23,16 @@ 25 26 #include "config.h" 27 28+#include "layer4.h" 29+#include "logger.h" 30+#include "scheduler.h" 31+#ifdef _WITH_LVS_ 32+#include "check_api.h" 33+#endif 34+#include "bitops.h" 35+#include "utils.h" 36+#include "align.h" 37+ 38 #include <stdio.h> 39 #include <errno.h> 40 #include <unistd.h> 41@@ -33,17 +43,6 @@ 42 #include <sys/time.h> 43 #endif 44 #include <linux/errqueue.h> 45-#include <netinet/in.h> 46- 47-#include "layer4.h" 48-#include "logger.h" 49-#include "scheduler.h" 50-#ifdef _WITH_LVS_ 51-#include "check_api.h" 52-#endif 53-#include "bitops.h" 54-#include "utils.h" 55-#include "align.h" 56 57 // #define ICMP_DEBUG 1 58 59