pping: Guard local definitions of AF_* constants in pping_kern.c

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 <toke@redhat.com>
This commit is contained in:
Toke Høiland-Jørgensen
2022-04-14 21:27:07 +02:00
parent 5ca0416e9e
commit 58fcc521b7

View File

@@ -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