33 Commits

Author SHA1 Message Date
John Sharratt
89130bf099 Now creating session on receiving NDP adverts even if no one has specifically asked for one yet thus ensuring the routes are created and that the latecy on proxy solicitation is kept much lower 2017-07-03 00:59:23 +02:00
John Sharratt
f2d5804959 Added additional logging on system calls and ensured that an error message rather than an error code is returned for easier debugging 2017-07-02 15:53:35 +02:00
John Sharratt
890d1a7821 Added a promiscuous mode that allows the proxy interface to also respond to queries send from the gateway (for instance when it needs to route to a WAN address thats local) 2017-07-02 10:59:19 +02:00
John Sharratt
1a691255e3 Now properly exiting if any of the interfaces are not opened rather than silently continuing 2017-07-02 00:12:00 +02:00
John Sharratt
2f10118a5c Now daemonizing after the configuration rather than before so that more errors are caught on the command line rather than via an ASYNC process 2017-07-02 00:11:58 +02:00
John Sharratt
68240908bc Separated the TTL so that invalid sessions can be expired faster than valid sessions (DDOS protection and better error handling) 2017-07-02 00:11:30 +02:00
John Sharratt
8ed35f841f Put in the skeleton around the auto wiring functionality 2017-07-02 00:11:22 +02:00
Daniel Adolfsson
8a8f7b065c Fix compilation problems and issue #20
- Netlink is disabled per default (compile with WITH_ND_NETLINK)

- Automatic loading of routes is only done if at least one rule
  uses the "auto" setting.
2017-05-08 12:31:13 +02:00
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