82 Commits

Author SHA1 Message Date
Ralf Ertzinger
b67f560309 Handle disappearing interfaces
When an interface disappears handle the resulting POLLERR
result from polling. Ignoring this will cause ndppd to go into
a hot loop.

This is a very simple fix that will make the daemon terminate.
2019-01-26 18:46:26 +01:00
John Sharratt
a008fad5f4 Doing some debugging on an issue with the routes not working from gateway hosted IPs 2017-07-05 22:50:35 +02:00
John Sharratt
4ca86ef88e Added a fix to stop nasty NDP loops when being proactive on the NDP adverts 2017-07-05 01:24:29 +02:00
John Sharratt
e8e3739126 Added session keepalive with retries that will ensure the routes are kept up during high traffic when no proactive NDP soliciations are sent by the sender 2017-07-04 22:00:03 +02:00
John Sharratt
1f50dc5b5a NDP proxy will now respond to Solicitation requests to gateway addresses that it holds on secondary interfaces 2017-07-04 20:17:53 +02:00
John Sharratt
a690d128e7 Added a global list of all the IP addresses that the interfaces of the local machine which will be used to cover some missing solicitation requests 2017-07-03 17:31:55 +02:00
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
f6ef3fe494 Was touching all the sessions rather than the one that had an solicitation request causing none of the sessions to really expire 2017-07-02 21:50: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
0fd1dc0308 Added some additional debug information that help help track down what triggers a particular failure path 2017-07-02 15:26:19 +02:00
John Sharratt
5c56cd3a6d Now restoring the promiscuous state of the interface when the appliance terminates 2017-07-02 12:11:30 +02:00
John Sharratt
4f11b9a4f0 Now restoring the promiscuous state of the interface when the appliance terminates 2017-07-02 11:57:01 +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
55ad4b11f0 Now only unwiring if the NDP proxy did the wiring in the first place 2017-07-02 00:11:56 +02:00
John Sharratt
701476417a Added some more debug information for what session is no longer valid when it times out 2017-07-02 00:11:51 +02:00
John Sharratt
2ceb687bdc Added some debugging when a valid session becomes invalid 2017-07-02 00:11:49 +02:00
John Sharratt
f8ea51ab5e Added automatic renewal of active sessions (what determines if its active can be improved in future) 2017-07-02 00:11:47 +02:00
John Sharratt
7e0948bf96 Added automatic unwiring when a session expires 2017-07-02 00:11:45 +02:00
John Sharratt
e11d1943e9 Added a command that updates the routing tables 2017-07-02 00:11:42 +02:00
John Sharratt
37181c81ca Added some more debug information for when a advert is received 2017-07-02 00:11:32 +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
aaaed4fce9 Added debug information that informs the autowire mode when creating a session 2017-07-02 00:11:24 +02:00
John Sharratt
8ed35f841f Put in the skeleton around the auto wiring functionality 2017-07-02 00:11:22 +02:00
Daniel Adolfsson
b30b654871 Add support for XSI-compliant strerror_r 2017-05-08 12:47:20 +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
Blair Steven
cf244c10f7 Send proxied NA to the correct destination address
We need to send the NA back to the All Nodes Multicast address
rather than attempting to route to "::".

Signed-off-by: Scott Parlane <scott.parlane@alliedtelesis.co.nz>
2016-09-21 15:09:36 +12: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
771f9ca29d Various changes (referencing issue #6);
- Fix a bug where re-reading routes would close the interfaces

- Allow unicast solicitation messages (experimental)
2016-05-17 08:55:06 +02: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
9499745013 Add cerrno include to logger.cc 2016-04-18 18:45:43 +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
Daniel Adolfsson
e49b71c0b7 Add some additional logging to allmulti() 2016-04-18 09:32:03 +02:00
Daniel Adolfsson
f19fa4be6a Fix a cast so it can be compiled with gcc-6 2016-04-08 13:32:22 +02:00
Daniel Adolfsson
b8b2d401b9 Preparation for 0.2.4 2015-10-13 15:25:22 +04: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
24aeceb060 Release 0.2.3 2012-09-21 13:13:15 +00:00
Jiri Kosina
fe5fe8e894 ndppd: remove unused variables
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Daniel Adolfsson <daniel@priv.nu>
2012-03-08 00:25:47 +01:00
Jiri Kosina
8ee4758b41 ndppd: fix initialization list ordering in constructors
Members are initialized in the order that they are declared in the class
definition not in the order they are written them in the initialization
list in the constructor. Fix the ordering.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Daniel Adolfsson <daniel@priv.nu>
2012-03-08 00:25:45 +01:00
Jiri Bohac
e827641e40 ndppd: fix setting the ALLMULTI flag
ifa->allmulti() uses ifa->fd before it is initialized.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Daniel Adolfsson <daniel@priv.nu>
2012-03-08 00:20:25 +01:00
Daniel Adolfsson
b3e45caf20 Fix a problem with iface::cleanup() where 'it' was incremented improperly 2012-02-07 22:28:53 +01:00
Daniel Adolfsson
0dbc3e288a A couple of bugfixes
* Fix a bug where pollfds would be changed while in the poll_all
    loop. This issue didn't exist before 'auto' was implemented.

  * Fix so 'auto' rules won't try to forward Neighbor Solicitation
    Packages through proxy's interface.

  * Some code cleanup.
2012-02-07 21:33:41 +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
d51acba693 Fix a uClibc++ compatibility issue using stringstream::rdbuf() 2012-02-04 13:43:39 +01:00
Daniel Adolfsson
3ba2e7797b Some more fixes related to ptr/weak_ptr 2012-02-04 11:02:49 +01:00
Daniel Adolfsson
244341b5cf Fix a couple of issues related to circular referencing (ptr/weak_ptr) 2012-02-04 09:41:41 +01:00