From dbee1b38b3fce2cab93c46157b9144bfab73cf87 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 29 Jun 2015 10:21:28 -0700 Subject: Fix semantics of std::unique() to actually remove duplicates (hidden memory leak?) --- node/InetAddress.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'node/InetAddress.hpp') diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp index 16e3f4d5..35fd4314 100644 --- a/node/InetAddress.hpp +++ b/node/InetAddress.hpp @@ -343,6 +343,17 @@ struct InetAddress : public sockaddr_storage */ inline void zero() throw() { memset(this,0,sizeof(InetAddress)); } + /** + * Check whether this is a network/route rather than an IP assignment + * + * A network is an IP/netmask where everything after the netmask is + * zero e.g. 10.0.0.0/8. + * + * @return True if everything after netmask bits is zero + */ + bool isNetwork() const + throw(); + /** * @return True if address family is non-zero */ -- cgit v1.2.3