Skip to content

Commit

Permalink
Doing some debugging on an issue with the routes not working from gat…
Browse files Browse the repository at this point in the history
…eway hosted IPs
  • Loading branch information
John Sharratt authored and John Sharratt committed Jul 5, 2017
1 parent 4ca86ef commit a008fad
Show file tree
Hide file tree
Showing 12 changed files with 532 additions and 189 deletions.
7 changes: 7 additions & 0 deletions ndppd.conf-dist
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ proxy eth0 {

auto

# autovia <yes|no|true|false>
# Any addresses updated using NDP advertisments will use a gateway to
# route traffic on this particular interface (only works wiith the iface
# rule type). Default is no

autovia no

# Note that before version 0.2.2 of 'ndppd', if you didn't choose a
# method, it defaulted to 'static'. For compatibility reasons we choose
# to keep this behavior - for now (it may be removed in a future version).
Expand Down
22 changes: 21 additions & 1 deletion src/address.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ bool address::operator!=(const address& addr) const
((_addr.s6_addr32[3] ^ addr._addr.s6_addr32[3]) & _mask.s6_addr32[3]));
}

bool address::is_empty() const
{
if (_addr.s6_addr32[0] == 0 &&
_addr.s6_addr32[1] == 0 &&
_addr.s6_addr32[2] == 0 &&
_addr.s6_addr32[3] == 0 &&
_mask.s6_addr32[0] == 0xffffffff &&
_mask.s6_addr32[1] == 0xffffffff &&
_mask.s6_addr32[2] == 0xffffffff &&
_mask.s6_addr32[3] == 0xffffffff)
return true;

return false;
}

void address::reset()
{
_addr.s6_addr32[0] = 0;
Expand Down Expand Up @@ -321,6 +336,10 @@ bool address::is_multicast() const

bool address::is_unicast() const
{
if (_addr.s6_addr32[2] == 0 &&
_addr.s6_addr32[3] == 0)
return false;

return _addr.s6_addr[0] != 0xff;
}

Expand Down Expand Up @@ -360,7 +379,8 @@ void address::load(const std::string& path)
ifs.getline(buf, sizeof(buf));

if (ifs.gcount() < 53) {
logger::debug() << "skipping entry (size=" << ifs.gcount() << ")";
if (ifs.gcount() > 0)
logger::debug() << "skipping entry (size=" << ifs.gcount() << ")";
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions src/address.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class address {
bool operator!=(const address& addr) const;

void reset();

bool is_empty() const;

const std::string to_string() const;

Expand Down
Loading

0 comments on commit a008fad

Please sign in to comment.