Skip to content

Commit

Permalink
Avoid redefinition compiler warnings when including linux/in.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Jan 24, 2018
1 parent 1d438f0 commit 2ff6afc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hsflowd-xen.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: host sFlow daemon
Name: hsflowd
Version: 2.0.12
Release: 1
Release: 2
License: http://sflow.net/license.html
Group: Applications/Internet
URL: http://sflow.net
Expand Down
15 changes: 13 additions & 2 deletions src/Linux/hsflowd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,19 @@ extern "C" {

#include <linux/version.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
#include "linux/in.h" // for IP_UNICAST_IF
#include "linux/in6.h" // for IPV6_UNICAST_IF
// Interface binding (for VRF) is supported.
// on some releases we risk triggering a flood of
// "redefinition" compiler errors if we include
// these...
//#include "linux/in.h" // for IP_UNICAST_IF
//#include "linux/in6.h" // for IPV6_UNICAST_IF
//... so just define the numbers we need:
#ifndef IP_UNICAST_IF
#define IP_UNICAST_IF 50
#endif
#ifndef IPV6_UNICAST_IF
#define IPV6_UNICAST_IF 76
#endif
#endif

#if defined(__GLIBC__) || defined(__UCLIBC__)
Expand Down

0 comments on commit 2ff6afc

Please sign in to comment.