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,11 +1,24 @@
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
* Fix an issue where ndppd daemonizes too early. * Fix an issue where ndppd daemonizes too early.
* Fix to make sure the right pid is written to the pidfile. * Fix to make sure the right pid is written to the pidfile.
2012-09-21 Daniel Adolfsson <daniel@priv.nu> 2012-09-21 Daniel Adolfsson <daniel@priv.nu>
* Version 0.2.3 * Version 0.2.3
@ -18,7 +31,7 @@
* New "auto" configuration to detect outgoing interface, for forwarding * New "auto" configuration to detect outgoing interface, for forwarding
Neighbor Solicitation Messages. Neighbor Solicitation Messages.
* Improved logging. * Improved logging.
* Bug fixes related to memory management. * Bug fixes related to memory management.

16
README
View File

@ -1,24 +1,24 @@
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
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
@ -93,7 +93,7 @@
If you want to enable debugging, you can type: If you want to enable debugging, you can type:
make DEBUG=1 all make DEBUG=1 all
Note that this version of the binary is much bigger, and the daemon Note that this version of the binary is much bigger, and the daemon
produces a lot of messages. produces a lot of messages.
@ -115,7 +115,7 @@
-d Daemonize the process, putting it in the background. -d Daemonize the process, putting it in the background.
Also enables syslogging. Also enables syslogging.
-v Increase logging verbosity. Can be used several times in -v Increase logging verbosity. Can be used several times in
order to increase even further. order to increase even further.
@ -126,7 +126,7 @@
Contact : Daniel Adolfsson <daniel@priv.nu> Contact : Daniel Adolfsson <daniel@priv.nu>
Website : https://github.com/DanielAdolfsson/ndppd Website : https://github.com/DanielAdolfsson/ndppd
Git : git://github.com/DanielAdolfsson/ndppd.git Git : git://github.com/DanielAdolfsson/ndppd.git
If you want to report a bug, you can either send me a mail directly, If you want to report a bug, you can either send me a mail directly,

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 == "") { pr->add_rule(addr, iface::open_ifd(*x_cf));
} else {
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 {