25 Commits

Author SHA1 Message Date
Jason Rippon
ab7b2aa3bb Add functionality to reply to NS packets which are destined for a proxied interface.
Uses netlink sockets to learn the addresses on the proxied
interfaces so that NS packets can be replied to (with a NA)
when the address is present.

Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
2016-10-27 17:22:23 +13:00
Isaac Lee
8afd356df3 ND proxy support for dynamic interfaces
Dynamic interfaces, such as tunnel and ppp, do not exist
in the kernel until it's fully configured. If nd proxy
is configured on such an interface, the ndppd config for
this interface should be written only when the interface's
fully configured (ie, having a valid ifindex value in apteryx).

The patch ensures that the ndppd config only contains interfaces
that have a valid ifindex. This is done by watching the interface
ifindex node in apteryx and trigger the ndppd config update callback
when ifindex has changed.

To make ndppd not exit when the config file contains an interface
that is not yet created, ndppd is patched to treat fd-bind error
as a valid return code so that the program does not try to
proxy the interface and will continue to run.

Signed-off-by: Scott Parlane <scott.parlane@alliedtelesis.co.nz>
2016-09-21 15:09:14 +12:00
Daniel Adolfsson
9709759270 Remove the default rule behavior 'static', this must now be specified.
Bump version to 0.2.5
2016-04-18 19:14:27 +02:00
Daniel Adolfsson
cb23cdbeac Defer the configuration until after daemonized 2016-04-18 15:49:02 +02:00
Daniel Adolfsson
96ab05dade When daemonizing, change umask to 0 and change working directory to /.
Patch provided by Tim Bruylants (https://github.com/tbr)
2016-04-18 09:37:56 +02:00
Tamas Szabo
6b08f63fff In order to get the correct pid, we should daemonize before writing the pidfile 2014-12-19 11:44:10 +02:00
Daniel Adolfsson
00da8bf7ba Fix issue #2 - ndppd dæmonizes too early 2013-02-12 13:26:27 +01:00
Daniel Adolfsson
13b81fdd97 Last major commit for version 0.2.2
* Fix so that "route-ttl" in ndppd.conf works

  * Fix a typo in ndppd.conf.5

  * Update "ndppd.conf" to reflect the big changes

  * Fix a bug with config loader

  * Fix so that "auto" will never forward a Neighbor Solicitation
    Message out through the "proxy" interface
2012-02-07 12:44:55 +01:00
Daniel Adolfsson
804800864a Fix minor memory leak and logging 2012-02-04 00:23:11 +01:00
Daniel Adolfsson
997499ec2b Update documentation for 0.2.2 and fix logging 2012-02-03 23:13:46 +01:00
Daniel Adolfsson
7956724a8e Fix a couple of memory leaks 2012-02-03 22:25:00 +01:00
Daniel Adolfsson
6723f2f4b6 Several large changes for the upcoming 0.2.2 version
- Bugfixes.

- New 'auto' configuration to be used in a 'rule' section.  When using
  this option, the routing table /proc/net/ipv6_route will be used to
  auto-detect which interface to use when forwarding solicitation messages.

- New 'route' class to resolve which interface to query when using
  'auto' configuration.

- Cleaned up the code some more.
2012-02-03 14:29:37 +01:00
Daniel Adolfsson
ab0ebe09ff Go back to using own implementation of smart pointers 2012-02-02 20:35:09 +01:00
Daniel Adolfsson
ffb4e6d398 New configuration implementation
First step in removing the libconfuse dependency.
2012-01-31 23:53:45 +01:00
Daniel Adolfsson
c8cc80925a New logging implementation
-  Switch from the old 'log' class (ERR/DBG/etc) to a better
   'logger' class. Also use LOG_* as defined in syslog.h.

-  Make it possible to read debug messages even for release.

-  Add a new argument (-v|--verbose) to 'ndppd' to change
   verbosity level.
2012-01-31 20:25:39 +01:00
Daniel Adolfsson
bc70f587ef Refactor source
- Change coding style

- Switch from own implementation of smart pointers to std::smart_ptr
  and std::weak_ptr
2012-01-28 20:28:07 +01:00
Daniel Adolfsson
d78bee25a7 Updated author's e-mail address 2012-01-26 11:21:07 +01:00
Daniel Adolfsson
d03e890269 Add support for creating pidfile through '-p' option 2011-09-18 15:22:30 +02:00
Daniel Adolfsson
9bf5799109 Multiple changes
* Change Makefile so release is the default mode, use DEBUG=1 to turn
  on debugging.

* Clean up 'conf' a bit.

* Add a new option 'router' (valid in 'proxy' section) to turn on/off
  the ND_NA_FLAG_ROUTER flag for adverts.
2011-09-18 02:25:43 +02:00
Daniel Adolfsson
c5b542e79c Small changes
* Make iface::read() return a bit more generic address (sockaddr).

* Add is_unicast() and is_multicast() to address.

* Set default config path to "/etc/ndppd.conf".

* Silently ignore solicit messages with bad saddr and/or daddr.
2011-09-18 01:31:27 +02:00
Daniel Adolfsson
eefa9cb881 Multiple changes
* Add '-d' to "daemonize". Will also enable syslogging.

* Fix a couple of bugs in 'session'.

* Clean up 'log', and use LOG_* macros instead.

* Add syslog(bool) to 'log' to enable/disable the use of syslog.
2011-09-17 16:37:24 +02:00
Daniel Adolfsson
62edaf3c6b Fix several bugs and clean up the code 2011-09-17 01:10:23 +02:00
Daniel Adolfsson
370ba70182 Multiple changes
- Clean up some junk code that was left over.

- Replace ptr<> with strong_ptr<> and weak_ptr<> to easier distinguish
  between weak and strong pointers.

- Fix a couple of bugs.
2011-09-16 22:59:37 +02:00
Daniel Adolfsson
35567ed082 Major changes 2011-09-16 22:59:29 +02:00
Daniel Adolfsson
7d84dbeb18 Initial commit 2011-09-13 21:26:12 +02:00