From 58fcc521b78fc23764b4ffe3c1e78d596d0c5e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Thu, 14 Apr 2022 21:27:07 +0200 Subject: [PATCH] pping: Guard local definitions of AF_* constants in pping_kern.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header files included from pping_kern.c include definitions of AF_INET and AF_INET6, leading to warnings like: pping_kern.c:25:9: warning: 'AF_INET' macro redefined [-Wmacro-redefined] ^ /usr/include/bits/socket.h:97:9: note: previous definition is here ^ pping_kern.c:26:9: warning: 'AF_INET6' macro redefined [-Wmacro-redefined] ^ /usr/include/bits/socket.h:105:9: note: previous definition is here ^ 2 warnings generated. Fix this by guarding the definitions behind suitable ifdefs. Signed-off-by: Toke Høiland-Jørgensen --- pping/pping_kern.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pping/pping_kern.c b/pping/pping_kern.c index 1dcb369..37fdee3 100644 --- a/pping/pping_kern.c +++ b/pping/pping_kern.c @@ -22,8 +22,12 @@ #include "pping.h" #include "pping_debug_cleanup.h" +#ifndef AF_INET #define AF_INET 2 +#endif +#ifndef AF_INET6 #define AF_INET6 10 +#endif #define MAX_TCP_OPTIONS 10 // Mask for IPv6 flowlabel + traffic class - used in fib lookup