Remove the default rule behavior 'static', this must now be specified.

Bump version to 0.2.5
This commit is contained in:
Daniel Adolfsson 2016-04-18 19:14:27 +02:00
parent 9499745013
commit 9709759270
3 changed files with 50 additions and 31 deletions

View File

@ -1,3 +1,16 @@
2016-04-18 Daniel Adolfsson <daniel@priv.nu>
* Version 0.2.5
* Defer configuration of interfaces until after daemonized; fixes an
issue where ndppd would fail to set ALLMULTI on the interface
properly.
* Fix a cast so ndppd can be compiled on GCC 6.
* Fix so ndppd changes working directory to / and umask to 0 once
daemonized.
2015-10-13 Daniel Adolfsson <daniel@priv.nu> 2015-10-13 Daniel Adolfsson <daniel@priv.nu>
* Version 0.2.4 * Version 0.2.4

4
README
View File

@ -1,13 +1,13 @@
ndppd - NDP Proxy Daemon ndppd - NDP Proxy Daemon
Version 0.2.4 Version 0.2.5
------------------------------------------------------------------------ ------------------------------------------------------------------------
1. Legal 1. Legal
------------------------------------------------------------------------ ------------------------------------------------------------------------
ndppd - NDP Proxy Daemon ndppd - NDP Proxy Daemon
Copyright (C) 2011 Daniel Adolfsson <daniel@priv.nu> Copyright (C) 2011-2016 Daniel Adolfsson <daniel@priv.nu>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@ -94,20 +94,34 @@ static ptr<conf> load_config(const std::string& path)
address addr(*ru_cf); address addr(*ru_cf);
if (x_cf = ru_cf->find("iface")) { if (x_cf = ru_cf->find("iface")) {
if ((const std::string& )*x_cf == "") { if (ru_cf->find("static") || ru_cf->find("auto")) {
logger::error()
<< "Only one of 'iface', 'auto' and 'static' may "
<< "be specified.";
return (conf*)NULL;
}
if ((const std::string&)*x_cf == "") {
logger::error() << "'iface' expected an interface name"; logger::error() << "'iface' expected an interface name";
return (conf*)NULL;
} }
} else { } else if (ru_cf->find("static")) {
if (!ru_cf->find("static")) { if (ru_cf->find("auto")) {
logger::warning() logger::error()
<< "## I'm going for 'static' since you didn't specify any method. Please fix this" << logger::endl << "Only one of 'iface', 'auto' and 'static' may "
<< "## as it's not going to be supported in future versions of ndppd. (See 'man ndppd.conf')"; << "be specified.";
return (conf*)NULL;
} }
if (addr.prefix() <= 120) { if (addr.prefix() <= 120) {
logger::warning() logger::warning()
<< "Low prefix length (" << addr.prefix() << " <= 120) when using 'static' method"; << "Low prefix length (" << addr.prefix()
<< " <= 120) when using 'static' method";
} }
} else if (!ru_cf->find("auto")) {
logger::error()
<< "You must specify either 'iface', 'auto' or "
<< "'static'";
return (conf*)NULL;
} }
} }
} }
@ -163,18 +177,10 @@ static bool configure(ptr<conf>& cf)
for (r_it = rules.begin(); r_it != rules.end(); r_it++) { for (r_it = rules.begin(); r_it != rules.end(); r_it++) {
ptr<conf> ru_cf =* r_it; ptr<conf> ru_cf =* r_it;
if (ru_cf->empty()) {
return false;
}
address addr(*ru_cf); address addr(*ru_cf);
if (x_cf = ru_cf->find("iface")) { if (x_cf = ru_cf->find("iface")) {
if ((const std::string& )*x_cf == "") {
} else {
pr->add_rule(addr, iface::open_ifd(*x_cf)); pr->add_rule(addr, iface::open_ifd(*x_cf));
}
} else if (ru_cf->find("auto")) { } else if (ru_cf->find("auto")) {
pr->add_rule(addr, true); pr->add_rule(addr, true);
} else { } else {