summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-07 17:19:33 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-07 17:19:33 -0700
commit9a3c34b5b3040711f1018e313046df4fac13b403 (patch)
tree21fd2658c2ac7afc0d3de78ff33173c3a13d9175 /osdep
parent951d911531ec1eaa246e234a7b31b6bf5bc6bb79 (diff)
downloadinfinitytier-9a3c34b5b3040711f1018e313046df4fac13b403.tar.gz
infinitytier-9a3c34b5b3040711f1018e313046df4fac13b403.zip
Build fix, use -Os on Linux too.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Binder.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index 1839ecc2..a0b47367 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -57,6 +57,7 @@
#include <algorithm>
#include <utility>
#include <map>
+#include <set>
#include "../node/NonCopyable.hpp"
#include "../node/InetAddress.hpp"
@@ -471,6 +472,20 @@ Binder_send_packet:
return aa;
}
+ /**
+ * @param addr Address to check
+ * @return True if this is a bound local interface address
+ */
+ inline bool isBoundLocalInterfaceAddress(const InetAddress &addr) const
+ {
+ Mutex::Lock _l(_lock);
+ for(std::vector<_Binding>::const_iterator b(_bindings.begin());b!=_bindings.end();++b) {
+ if (b->address == addr)
+ return true;
+ }
+ return false;
+ }
+
private:
std::vector<_Binding> _bindings;
Mutex _lock;