diff --git a/ChangeLog b/ChangeLog index c130fe4..ebcc24e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,24 @@ +2016-04-18 Daniel Adolfsson + + * 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 * Version 0.2.4 - - * Fix an issue where ndppd daemonizes too early. - - * Fix to make sure the right pid is written to the pidfile. - + + * Fix an issue where ndppd daemonizes too early. + + * Fix to make sure the right pid is written to the pidfile. + 2012-09-21 Daniel Adolfsson * Version 0.2.3 @@ -18,7 +31,7 @@ * New "auto" configuration to detect outgoing interface, for forwarding Neighbor Solicitation Messages. - + * Improved logging. * Bug fixes related to memory management. diff --git a/README b/README index ac3c71d..05412af 100644 --- a/README +++ b/README @@ -1,24 +1,24 @@ ndppd - NDP Proxy Daemon - Version 0.2.4 + Version 0.2.5 ------------------------------------------------------------------------ 1. Legal ------------------------------------------------------------------------ ndppd - NDP Proxy Daemon - Copyright (C) 2011 Daniel Adolfsson - + Copyright (C) 2011-2016 Daniel Adolfsson + 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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . @@ -93,7 +93,7 @@ If you want to enable debugging, you can type: make DEBUG=1 all - + Note that this version of the binary is much bigger, and the daemon produces a lot of messages. @@ -115,7 +115,7 @@ -d Daemonize the process, putting it in the background. Also enables syslogging. - + -v Increase logging verbosity. Can be used several times in order to increase even further. @@ -126,7 +126,7 @@ Contact : Daniel Adolfsson Website : https://github.com/DanielAdolfsson/ndppd - + Git : git://github.com/DanielAdolfsson/ndppd.git If you want to report a bug, you can either send me a mail directly, diff --git a/src/ndppd.cc b/src/ndppd.cc index c7b540d..bec9656 100644 --- a/src/ndppd.cc +++ b/src/ndppd.cc @@ -94,20 +94,34 @@ static ptr load_config(const std::string& path) address addr(*ru_cf); 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"; + return (conf*)NULL; } - } else { - if (!ru_cf->find("static")) { - logger::warning() - << "## I'm going for 'static' since you didn't specify any method. Please fix this" << logger::endl - << "## as it's not going to be supported in future versions of ndppd. (See 'man ndppd.conf')"; + } else if (ru_cf->find("static")) { + if (ru_cf->find("auto")) { + logger::error() + << "Only one of 'iface', 'auto' and 'static' may " + << "be specified."; + return (conf*)NULL; } - if (addr.prefix() <= 120) { 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& cf) for (r_it = rules.begin(); r_it != rules.end(); r_it++) { ptr ru_cf =* r_it; - if (ru_cf->empty()) { - return false; - } - address addr(*ru_cf); 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")) { pr->add_rule(addr, true); } else {