Permalink
Browse files

interface index fix for non-Linux, unicast neg mgmt message display f…

…unction fix
  • Loading branch information...
1 parent 7e3722c commit 23345cc54835c245858c1a9adb291a46d61bef8c @wowczarek wowczarek committed Dec 8, 2015
Showing with 14 additions and 1 deletion.
  1. +6 −0 configure.ac
  2. +7 −0 src/dep/net.c
  3. +1 −1 src/ptpd.h
View
@@ -196,6 +196,12 @@ AC_CHECK_MEMBERS([struct ntptimeval.tai], [], [],
# Check for ifr_hwaddr in the ifreq structure
AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr], [], [], [[#include <net/if.h>]])
+# Check for ifr_index in the ifreq structure
+AC_CHECK_MEMBERS([struct ifreq.ifr_index], [], [], [[#include <net/if.h>]])
+
+# Check for ifr_ifindex in the ifreq structure
+AC_CHECK_MEMBERS([struct ifreq.ifr_ifindex], [], [], [[#include <net/if.h>]])
+
# ether_add: octet vs. ether_addr_octet - FreeBSD, any others?
AC_CHECK_MEMBERS([struct ether_addr.octet], [], [],
[
View
@@ -434,9 +434,16 @@ static int getInterfaceIndex(char *ifaceName)
}
+#if defined(HAVE_STRUCT_IFREQ_IFR_INDEX)
+ return ifr.ifr_index;
+#elif defined(HAVE_STRUCT_IFREQ_IFR_IFINDEX)
return ifr.ifr_ifindex;
+#else
+ return 0;
#endif
+#endif /* !SIOCGIFINDEX */
+
}
static Boolean getInterfaceInfo(char* ifaceName, InterfaceInfo* ifaceInfo)
View
@@ -443,7 +443,7 @@ void mMClockAccuracy_display(const MMClockAccuracy*, const PtpClock*);
void mMUtcProperties_display(const MMUtcProperties*, const PtpClock*);
void mMTraceabilityProperties_display(const MMTraceabilityProperties*, const PtpClock*);
void mMTimescaleProperties_display(const MMTimescaleProperties*, const PtpClock*);
-void mMUnicastNegotiationEnable(const MMUnicastNegotiationEnable*, const PtpClock*);
+void mMUnicastNegotiationEnable_display(const MMUnicastNegotiationEnable*, const PtpClock*);
void mMDelayMechanism_display(const MMDelayMechanism*, const PtpClock*);
void mMLogMinPdelayReqInterval_display(const MMLogMinPdelayReqInterval*, const PtpClock*);
void mMErrorStatus_display(const MMErrorStatus*, const PtpClock*);

0 comments on commit 23345cc

Please sign in to comment.