diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-29 10:21:28 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-29 10:21:28 -0700 |
| commit | dbee1b38b3fce2cab93c46157b9144bfab73cf87 (patch) | |
| tree | 9b2097871c534acf11adedd963808c7190391f90 /node/InetAddress.hpp | |
| parent | 3f71afd0fbb2d87a2c9288166299600da51470dc (diff) | |
| download | infinitytier-dbee1b38b3fce2cab93c46157b9144bfab73cf87.tar.gz infinitytier-dbee1b38b3fce2cab93c46157b9144bfab73cf87.zip | |
Fix semantics of std::unique() to actually remove duplicates (hidden memory leak?)
Diffstat (limited to 'node/InetAddress.hpp')
| -rw-r--r-- | node/InetAddress.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp index 16e3f4d5..35fd4314 100644 --- a/node/InetAddress.hpp +++ b/node/InetAddress.hpp @@ -344,6 +344,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 */ inline operator bool() const throw() { return (ss_family != 0); } |
