Skip to content

Commit 58fcc52

Browse files
committed
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>
1 parent 5ca0416 commit 58fcc52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pping/pping_kern.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
#include "pping.h"
2323
#include "pping_debug_cleanup.h"
2424

25+
#ifndef AF_INET
2526
#define AF_INET 2
27+
#endif
28+
#ifndef AF_INET6
2629
#define AF_INET6 10
30+
#endif
2731
#define MAX_TCP_OPTIONS 10
2832

2933
// Mask for IPv6 flowlabel + traffic class - used in fib lookup

0 commit comments

Comments
 (0)