summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-12-21 16:15:39 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-12-21 16:15:39 -0800
commit436c1fac1dc9daed033ca78719031b687b984c29 (patch)
tree10a78810012fef7e55553867c780c5ceae99b6f8 /osdep
parenta4cfe4cd1650ea7e9aada0b004fd7aade2e43ced (diff)
downloadinfinitytier-436c1fac1dc9daed033ca78719031b687b984c29.tar.gz
infinitytier-436c1fac1dc9daed033ca78719031b687b984c29.zip
Selectively move over changes from "edge" to "dev" excluding netcon.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Phy.hpp11
-rw-r--r--osdep/PortMapper.cpp4
2 files changed, 14 insertions, 1 deletions
diff --git a/osdep/Phy.hpp b/osdep/Phy.hpp
index 1ba6c40b..2dcda982 100644
--- a/osdep/Phy.hpp
+++ b/osdep/Phy.hpp
@@ -245,6 +245,12 @@ public:
static inline ZT_PHY_SOCKFD_TYPE getDescriptor(PhySocket *s) throw() { return reinterpret_cast<PhySocketImpl *>(s)->sock; }
/**
+ * @param s Socket object
+ * @return Pointer to user object
+ */
+ static inline void** getuptr(PhySocket *s) throw() { return &(reinterpret_cast<PhySocketImpl *>(s)->uptr); }
+
+ /**
* Cause poll() to stop waiting immediately
*
* This can be used to reset the polling loop after changes that require
@@ -376,7 +382,10 @@ public:
f = 0; setsockopt(s,IPPROTO_IP,IP_MTU_DISCOVER,&f,sizeof(f));
#endif
#ifdef SO_NO_CHECK
- if (_noCheck) {
+ // For now at least we only set SO_NO_CHECK on IPv4 sockets since some
+ // IPv6 stacks incorrectly discard zero checksum packets. May remove
+ // this restriction later once broken stuff dies more.
+ if ((localAddress->sa_family == AF_INET)&&(_noCheck)) {
f = 1; setsockopt(s,SOL_SOCKET,SO_NO_CHECK,(void *)&f,sizeof(f));
}
#endif
diff --git a/osdep/PortMapper.cpp b/osdep/PortMapper.cpp
index 87c886c2..03e2648f 100644
--- a/osdep/PortMapper.cpp
+++ b/osdep/PortMapper.cpp
@@ -40,10 +40,14 @@
#include "OSUtils.hpp"
#include "PortMapper.hpp"
+// These must be defined to get rid of dynamic export stuff in libminiupnpc and libnatpmp
#ifdef __WINDOWS__
#ifndef MINIUPNP_STATICLIB
#define MINIUPNP_STATICLIB
#endif
+#ifndef STATICLIB
+#define STATICLIB
+#endif
#endif
#include "../ext/miniupnpc/miniupnpc.h"