Commit Graph

54 Commits

Author SHA1 Message Date
Nick Hainke e62b8b54b9 babeld: add me as maintainer
I am maintaining the ubus bindings and also the luci-app-babeld.
I am very glad that ubus is included and that is why I do not want
babeld maintainer to have extra work.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-06-06 16:57:26 +02:00
Nick Hainke dc22d38f91 babeld: update to 1.10
25 April 2021: babeld-1.10
  * Removed the disambiguation code: source-specific routing is no longer
    supported for IPv4, and for IPv6 only on Linux 3.11 or later.
  * Fixed an issue handling of retractions with no next hop, which caused
    interoperability problems with BIRD.  Thanks to Fabian Bläse.
  * If skip-kernel-setup is set, we no longer disable the rp_filter, which
    makes babeld work in containers.  Thanks to Martin Weinelt.

Remove upstreamed part of ubus patch:
-  local: make local_kind function accessible

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-06-02 21:24:13 +02:00
Nick Hainke 83774bf54a babeld: bump copyright and use SPDX
Use SPDX license headers to be machine readable.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-06-02 21:24:13 +02:00
Polynomdivision 86991248ac
babeld: adopt to upstream header-style (#640)
babeld: adopt to upstream header-style

Instead of including the headerfiles that define the structs, we add
forward definitions to our headerfile.

Fixes warning:

ubus.h:67:32: warning: 'struct xroute' declared inside parameter list will not be visible outside of this definition or declaration
 void ubus_notify_xroute(struct xroute *xroute, int kind);
                                ^~~~~~
Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-02-09 22:51:39 +01:00
Polynomdivision 72408a9cf8
babeld: fix compiler warnings (#639)
babeld: fix compiler warnings

Fixes:
- "route_list_entry" points to "struct babel_route"
- "format_thousands" returns a string pointer
- "UBUS_METHOD_NOARG" wants a function returning an integer

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-02-01 20:40:17 +01:00
Polynomdivision 519c1ff731
babeld: send events via ubus (#633)
* babeld: send events via ubus

Send a notification via the ubus bus if we experience any changes in
neighbours, routes or xroutes.

The format looks like this:
  {route,xroute,neighbour}.add: Object was added
  {route,xroute,neighbour}.change: Object was changed
  {route,xroute,neighbour}.flush: Object was flushed

If ubus_bindings is turned off, it will minimally effect performance,
since only an if-statement has to be evaluated.
If no subscriber is available, it will minimally change the performance,
since only an if-statmenet that checks for subscribers has to be
evaluated.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-02-01 15:26:44 +01:00
Nick Hainke ea4a3f28dc babeld: add ubus bindings
A better integration of babeld with OpenWrt is to connect the daemon to
the IPC. So far, we can only communicate via a websocket. With ubus we
can send and receive commands in json format.

The commit adds a ubus interface to babeld with following functions:
- get_info
- get_neighbours
- get_xroutes
- get_routes

All output is divided into IPv4 and IPv6.

Ubus has to be enabled by setting "config general"
  option 'ubus_bindings' 'true'

Example:

root@OpenWrt:~# ubus call babeld get_info
{
	"babeld-version": "babeld-1.9.2",
	"my-id": "32:xx:xx:xx:xx:xx:xx:xx",
	"host": "OpenWrt"
}

root@OpenWrt:~# ubus call babeld get_neighbours
{
	"IPv4": {

	},
	"IPv6": {
		"fe80::xx:xx:xx:xxx": {
			"dev": "br-lan",
			"hello-reach": 65408,
			"uhello-reach": 0,
			"rxcost": 96,
			"txcost": 96,
			"rtt": 4338271,
			"channel": -2,
			"if_up": true
		}
	}
}

root@OpenWrt:~# ubus call babeld get_xroutes
{
	"IPv4": {
		"10.0.0.3/32": {
			"src-prefix": "0.0.0.0/0",
			"metric": 0
		},
		"10.0.0.0/24": {
			"src-prefix": "0.0.0.0/0",
			"metric": 0
		}
	},
	"IPv6": {
		"fdfa:xx:xx::1/128": {
			"src-prefix": "::/0",
			"metric": 0
		}
	}
}

root@OpenWrt:~# ubus call babeld get_routes
{
	"IPv4": {
		"10.2.0.1/32": {
			"src-prefix": "0.0.0.0/0",
			"route_metric": 96,
			"route_smoothed_metric": 96,
			"refmetric": 0,
			"id": "62:xx:xx:xx:xx:xx:xx:xx",
			"seqno": 41381,
			"channels": "",
			"age": 17,
			"via": "fe80::xx:xxxx:xxxx:xxxx",
			"nexthop": " nexthop ",
			"installed": true,
			"feasible": true
		},
	"IPv6": {

	}
}

Additional IPC functionality will follow.

Further, we changed the version to $version-ubus-mod.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-15 01:13:26 +01:00
Fabian Bläse 07bdc8f422 babeld: Update to version 1.9.2
21 April 2020: babeld-1.9.2

  * Fixed two issues that could cause IPv4 routes to be represented
    incorrectly, with a range of confusing symptoms.  Thanks to
    Fabian Bläse.
  * Fixed incorrect parsing of TLVs with an unknown Address Encoding.
    Thanks to Théophile Bastian.
  * Fixed access to mis-aligned data structure.  Thanks to Antonin Décimo.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-04-22 14:11:16 +02:00
Baptiste Jonglez 3e3d16338d babeld: Update example configuration file
More example filters are provided, and new options such as "type" or
"pref_src" are given as example.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2019-08-26 20:52:37 +02:00
Baptiste Jonglez 06f821adc1 babeld: Update description in Makefile and fix license path
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2019-08-26 18:40:35 +02:00
Adrian Schmutzler 4d62e08852 babeld: Update to version 1.9.1
20 August 2019: babeld-1.9.1

  * Fixed a crash that could happen when unicast and RTT estimation are
    both enabled on an interface.  Thanks to Dave Taht.
  * Fixed compilation under BSD.  Thanks to Dave Taht.

4 August 2019: babeld-1.9.0

  * Reworked buffering of unicast packets to use a per-neighbour buffer
    rather than a single buffer per interface.  This makes unicast as
    efficient as multicast, at the cost of slightly higher memory usage.
  * Added option "unicast" that allows sending most TLVs over unicast.
    This is necessary for the DTLS extension.
  * Implemented parsing of unicast Hellos.  This makes it possible to
    interoperate with neighbours that only speak unicast (e.g. over some
    kinds of tunnels that only do unicast).
  * Implemented sending of unscheduled unicast Hellos.  This makes the
    RTT extension work over unicast too.
  * Reworked the xroute data structures to use binary search and
    linear-time comparison.
  * Don't attempt to modify the rp_filter sysctl if it already has the
    desired value; this makes it possible to run babeld in an
    unpriviledged container.  Thanks to Christof Schulze.
  * Reinstated logging of late hellos.  Thanks to Dave Taht.
  * Don't send wildcard requests or Hellos to newish nodes.  This makes
    acquisition of new neighbours slower, but drastically reduces noise at
    startup.  Thanks to Teco Boot.
  * Remove an arbitrary limit on the number of interfaces.  Thanks to
    Christof Schulze.
  * Removed class E from martian filter.  Thanks to Dave Taht.
  * Added the ability to set the preferred source address in install filters.
    Thanks to Killian Lufau.
  * Fixed a number of read-only buffer overflows.  Thanks to Leo Stefanesco.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-26 18:40:35 +02:00
Adrian Schmutzler 7eeee8124a babeld: Improve Makefile formatting
This applies some style improvements to make this ready for
migration to openwrt/packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-26 18:40:35 +02:00
Adrian Schmutzler 5a7cf37dc0 babeld: Update to version 1.8.5
Changes:

  * Fixed a bug that caused confustion between learned routes and
    imported routes (thanks to Fabian Bläse).
  * Fixed a bug that prevented install filters from being evaluated
    (thanks to Killian Lufau).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-26 18:40:35 +02:00
Baptiste Jonglez 6a92b45fac babeld: Don't kill -9 on stop
Killing anything with -9 is a bad idea.  When killed this way, babeld
won't be able to properly disassociate from its neighbours, withdraw its
announced routes or remove routes from the kernel.

This got introduced in bab933d4ca ("babeld: Update to version 1.8.3 +
fix init") with an unrelated change.  The purpose of the change is unclear
because stopping and restarting babeld worked fine without this change.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2019-08-26 18:40:35 +02:00
Robert Marko 6151c44f22
babeld: Update to version 1.8.4
9 November 2018: babeld-1.8.4

  * Fixed a bug that discarded pipelined commands received on the local
    configuration interface.
* Added the per-interface option rfc6126-compatible.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2018-11-11 00:34:59 +01:00
Michael Adams bab933d4ca babeld: Update to version 1.8.3 + fix init
24 September 2018: babeld-1.8.3

  * Fixed a read-only two byte buffer overflow in the packet parser.
    This is a read-only overflow, and hence most probably not exploitable.
  * Fixed an issue with creating unreachable routes on recent kernels
    (4.16 and up).  Thanks to Christof Schulze.
  * Notice interface changes faster by listening to more netlink events.
    Thanks to Christof Schulze.
  * Fixed a local interface issue when an interface has no link-local
    address.  Thanks to Christof Schulze.

Also, the init script was edited to kill babeld on stop; restart works properly now, as well.

Signed-off-by: Michael Adams <unquietwiki@gmail.com>
2018-10-03 10:04:46 -07:00
Daniel Engberg 43449bcbbd treewide: Basic cleanup and alignment to package guidelines (#383)
This is a very basic cleanup, several packages needs more work
but this at least drops git for https and removes the use of
PKG_MD5SUM and some minor fixes.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2018-07-12 16:50:47 +02:00
Baptiste Jonglez a71ecc3ddd babeld: Update to 1.8.2
This fixes a serious bug where IPv4 routes were not being redistributed.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2018-05-13 01:05:58 +02:00
Gabriel Kerneis 7fc2fbdfc1
babeld: release 1.8.1 2018-04-10 17:49:18 +02:00
Baptiste Jonglez 1aacfea7b3 babeld: Cleanup old compatibility code in initscript
It makes the init script more readable.  It has been more than two years
since babeld 1.5.1, let's hope nobody is still using the old
(undocumented) option names.

Incidentally, this commit fixes support for the "conf_dir" option,
introduced by ac643416dc ("babeld: allow changing alternative
configuration file and directory").  The default value of $OTHERCONFIGDIR
was always used, because the variable was used *before* it was (possibly)
redefined when parsing the UCI config.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-16 00:13:15 +01:00
Baptiste Jonglez ba5bffa6f4 babeld: Add myself as maintainer
Also update my email address in the main MAINTAINERS file.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-12 23:09:30 +01:00
Baptiste Jonglez 4868ec008e babeld: Update project URL again…
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-09 17:12:19 +01:00
Baptiste Jonglez 4c963b1b85 babeld: Bump PKG_RELEASE because of procd support
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-09 17:11:58 +01:00
Baptiste Jonglez ebfb650f01 babeld: add dynamic config files to the procd watch list
This way, "/etc/init.d/babeld reload" will detect when one of these
dynamic config files has changed, and restart babeld only if that is the
case.

Dynamic config files where introduced by 82d9002689 ("babeld: add support
for dynamic config files").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-09 17:07:40 +01:00
Baptiste Jonglez 669fe615c6 babeld: Properly quote variables
This was mostly introduced by 82d9002689 ("babeld: add support for dynamic
config files").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-09 16:05:06 +01:00
Baptiste Jonglez fd424268ba babeld: Log to the system log instead of logging to a file
This avoids running out of flash or RAM space if babeld logs too much.
The system log is stored on RAM by default and has a controlled size.

It is still possible to tell babeld to log to a file, by using the
following in /etc/config/babeld:

    config general
        option log_file "/var/log/babeld.log"

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-01-09 15:43:01 +01:00
Imuli 159dc575a6 babeld: procd support
note: dependant on openwrt commit 85fabd68, adding support for null arguments.
2017-01-09 15:37:52 +01:00
Christof Schulze 5b35f4b805 babeld: update to version 1.8 which is compatible to 1.7.1
Signed-off-by: Christof Schulze <christof.schulze@gmx.net>
2016-12-22 13:53:42 +01:00
Baptiste Jonglez 2dc7fe57e6 babeld: Update source URL
There is a HTTP redirection in place from the old URL to the new URL, but
better change it now than waiting for the redirection to disappear.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2016-07-30 13:29:00 +02:00
Alexander Couzens 9b610a90c6 replace DEPENDS=+@IPV6 with DEPENDS=@IPV6
The symbol IPV6 is a global config symbol, don't select it because it
will override the user decision of IPV6 as all other package in base do
it. A select (+) will also create a recursive dependency error.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-06-05 03:07:20 +02:00
Gabriel Kerneis 4af2fcd647 babeld: release 1.7.1
Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2016-02-15 11:00:15 +01:00
Markus Stenberg a0d7ff3f1a babeld: Fixed kmod-ipv6 dependency. 2015-12-11 13:50:38 +02:00
Nils Schneider 234c9d97a6 babeld: fix parsing of list import_table
When parsing list options using config_load option_cb will be called
with additional options ending in _ITEM$x and _LENGTH. This ignores any
option containing _LENGTH or _ITEM as they can't possible be a valid
babeld option making a config like

    config general
        list import_table 23
        list import_table 42

work.

Signed-off-by: Nils Schneider <nils@nilsschneider.net>
2015-08-16 18:54:32 +02:00
Gabriel Kerneis 2a636973eb babeld: bump to 1.6.1
16 June 2015: babeld-1.6.1.
  * Fixed a buffer overflow in zone_equal.  This is probably not
    exploitable, but might cause incorrect routing tables in the presence
    of source-specific routing.
  * Added support for defaulting ipv6-subtrees automatically based on the
    kernel version.
  * Fixed compilation under musl.

Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2015-06-17 10:56:44 +02:00
Gabriel Kerneis ac643416dc babeld: allow changing alternative configuration file and directory
Signed-off-by: Gabriel Kerneis <kerneis@google.com>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-21 11:44:19 +03:00
Steven Barth b39fa42c62 babeld: remove unnecessary librt linking & dependency
Signed-off-by: Steven Barth <steven@midlink.org>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-21 11:44:19 +03:00
Steven Barth 82d9002689 babeld: add support for dynamic config files
Signed-off-by: Steven Barth <steven@midlink.org>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-21 11:44:19 +03:00
Jernej Kos 1520babe9d babeld: Added missing $IPKG_INSTROOT.
Signed-off-by: Jernej Kos <jernej@kos.mx>
2015-05-02 19:33:57 +02:00
Gabriel Kerneis c5f795cc38 babeld: tweak configuration for source-specific features
- Enable ipv6-subtrees by default.
- Add UCI options to configure source-specific filters.

Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2015-04-21 10:29:58 +02:00
Gabriel Kerneis f425d537a0 babeld: update to release 1.6.0
14 April 2014: babeld-1.6.0

* Added support for source-specific routing.  Thanks to Matthieu Boutier.
* Added support for reflecting metrics as kernel priorities.  Thanks to
  Pierre Pfister.
* Worked around a Linux kernel bug with an infinite EAGAIN loop.  Thanks
  to Dave Taht.
* Changed wildcard updates to not set flag 0x40.  Reported by Markus
  Stenberg.
* Made ipv6-subtrees a runtime option.  Thanks to Matthieu Boutier.

Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2015-04-17 21:04:31 +02:00
Steven Barth 69f203d5c3 Add SPDX license tags
Signed-off-by: Steven Barth <steven@midlink.org>
2014-11-03 13:17:00 +01:00
Casper Meijn 959f053b48 babeld: create the directory for the config file before writing to it 2014-09-08 14:50:46 +02:00
Baptiste Jonglez 5a554d27cc babeld: Specify edge cases 2014-09-03 15:12:33 +02:00
Baptiste Jonglez de3e16ba82 babeld: Backward compatibility with old config files
This allows to use the old syntax "config interface foo" for specifying an
interface.  The new syntax ("option ifname foo") takes precedence.

Also, old option names for the "general" section are translated
accordingly.  Exceptions are:

- 'hello_interval' and 'wired_hello_interval', which are now interface-specific;
- 'conf_file', since /etc/babeld.conf is now always used;

which are simply ignored.

Beware, the syntax for the 'diversity' option is not backward compatible.
2014-08-31 00:53:36 +02:00
Baptiste Jonglez 8fb7fe0a59 babeld: Update configuration file for new syntax 2014-08-31 00:49:27 +02:00
Baptiste Jonglez 9bb7b1b03b babeld: Support default interface configuration
When a "section interface" does not have a "option ifname", all its
options are used as default interface options.
2014-08-29 10:19:42 +02:00
Baptiste Jonglez 539de92a4c babeld: Take interface name from "option ifname"
Previously, we were using the name of the section as the interface name,
but this has several drawbacks:

- no "-" or other special characters are allowed in a section name,
  preventing some physical interface names to be specified this way
  (e.g. "tun-topeka" would not work)
- it is harder to support default interface options (no interface name)

This change is not backward compatible, but a later commit will fix that.
2014-08-29 10:19:42 +02:00
Baptiste Jonglez a4f5570e79 babeld: Handle ignore options 2014-08-29 10:19:41 +02:00
Baptiste Jonglez 84422673a4 babeld: Print an error when startup fails 2014-08-29 10:19:41 +02:00
Baptiste Jonglez f81d53fad2 babeld: Generate a configuration file instead of passing cmdline arguments
This is the first step toward fixing issue #33.

This still lacks some features:

- no support for "ignore" options
- no backward compatibility for option names
- no support for default interface options
2014-08-29 10:19:41 +02:00