From 6a92b45fac111880c3f2cb2240da40cb529ecdce Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:39:37 +0200 Subject: [PATCH 1/6] 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 bab933d4cad8 ("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 --- babeld/files/babeld.init | 4 ---- 1 file changed, 4 deletions(-) diff --git a/babeld/files/babeld.init b/babeld/files/babeld.init index 7b25ef4..378a8ab 100755 --- a/babeld/files/babeld.init +++ b/babeld/files/babeld.init @@ -197,10 +197,6 @@ start_service() { procd_close_instance } -stop_service() { - killall -9 babeld -} - service_triggers() { procd_add_reload_trigger babeld } From 5a7cf37dc0c63009620668426b753a830b1bdcce Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 15:45:50 +0200 Subject: [PATCH 2/6] babeld: Update to version 1.8.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- babeld/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 870f175..972862c 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld -PKG_VERSION:=1.8.4 +PKG_VERSION:=1.8.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ -PKG_HASH:=98070dc418c190f047b8d69eb47987df30ded8f0fca353c49427d3137ad08b87 +PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 PKG_LICENSE:=MIT include $(INCLUDE_DIR)/package.mk From 7eeee8124a6b0cda97ab03f023b24f006bfa88bf Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 15:56:50 +0200 Subject: [PATCH 3/6] babeld: Improve Makefile formatting This applies some style improvements to make this ready for migration to openwrt/packages. Signed-off-by: Adrian Schmutzler --- babeld/Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 972862c..8e7f589 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -14,7 +14,11 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 + +PKG_MAINTAINER:=Gabriel Kerneis , \ + Baptiste Jonglez PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE include $(INCLUDE_DIR)/package.mk @@ -24,19 +28,17 @@ define Package/babeld SUBMENU:=Routing and Redirection TITLE:=A loop-free distance-vector routing protocol URL:=https://www.irif.fr/~jch/software/babel/ - MAINTAINER:=Gabriel Kerneis , \ - Baptiste Jonglez DEPENDS:=@IPV6 endef define Package/babeld/description - Babel is a loop-avoiding distance-vector routing protocol roughly based - on DSDV and AODV, but with provisions for link cost estimation and - redistribution of routes from other routing protocols. - While it is optimised for wireless mesh networks, Babel will also work - efficiently on wired networks. It will generate between 1.2 and 2.4 times - the amount of routing traffic that RIPng would generate, while - never counting to infinity. + Babel is a loop-avoiding distance-vector routing protocol roughly based + on DSDV and AODV, but with provisions for link cost estimation and + redistribution of routes from other routing protocols. + While it is optimised for wireless mesh networks, Babel will also work + efficiently on wired networks. It will generate between 1.2 and 2.4 times + the amount of routing traffic that RIPng would generate, while + never counting to infinity. endef define Package/babeld/conffiles From 4d62e08852434b08bd27cbdea035de3b0e931819 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 16:09:18 +0200 Subject: [PATCH 4/6] 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 --- babeld/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 8e7f589..d419e04 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld -PKG_VERSION:=1.8.5 +PKG_VERSION:=1.9.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ -PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 +PKG_HASH:=1e1b3c01dd929177bc8d027aff1494da75e1e567e1f60df3bb45a78d5f1ca0b4 PKG_MAINTAINER:=Gabriel Kerneis , \ Baptiste Jonglez From 06f821adc14c2c85ddf2011631729e08a01e9581 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:12:50 +0200 Subject: [PATCH 5/6] babeld: Update description in Makefile and fix license path Signed-off-by: Baptiste Jonglez --- babeld/Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index d419e04..022d0b8 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -18,7 +18,7 @@ PKG_HASH:=1e1b3c01dd929177bc8d027aff1494da75e1e567e1f60df3bb45a78d5f1ca0b4 PKG_MAINTAINER:=Gabriel Kerneis , \ Baptiste Jonglez PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE +PKG_LICENSE_FILES:=LICENCE include $(INCLUDE_DIR)/package.mk @@ -26,19 +26,17 @@ define Package/babeld SECTION:=net CATEGORY:=Network SUBMENU:=Routing and Redirection - TITLE:=A loop-free distance-vector routing protocol + TITLE:=A loop-avoiding distance-vector routing protocol URL:=https://www.irif.fr/~jch/software/babel/ DEPENDS:=@IPV6 endef define Package/babeld/description - Babel is a loop-avoiding distance-vector routing protocol roughly based - on DSDV and AODV, but with provisions for link cost estimation and - redistribution of routes from other routing protocols. - While it is optimised for wireless mesh networks, Babel will also work - efficiently on wired networks. It will generate between 1.2 and 2.4 times - the amount of routing traffic that RIPng would generate, while - never counting to infinity. + Babel is a loop-avoiding distance-vector routing protocol for IPv6 and IPv4 + with fast convergence properties. It is based on the ideas in DSDV, AODV and + Cisco's EIGRP, but is designed to work well not only in wired networks but + also in wireless mesh networks, and has been extended with support for + overlay networks. Babel is in the process of becoming an IETF Standard. endef define Package/babeld/conffiles From 3e3d16338dbb02753e3df35b4e34d03a139e59ff Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:25:32 +0200 Subject: [PATCH 6/6] 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 --- babeld/files/babeld.config | 49 +++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/babeld/files/babeld.config b/babeld/files/babeld.config index 0073f73..a02f202 100644 --- a/babeld/files/babeld.config +++ b/babeld/files/babeld.config @@ -1,5 +1,7 @@ package babeld +# Detailed documentation: https://openwrt.org/docs/guide-user/services/babeld + # Babeld reads options from the following files (the last one takes precedence # if an option is defined in several places): # - the file defined by the option conf_file (default: /etc/babeld.conf), @@ -39,7 +41,10 @@ config interface option 'ignore' 'true' ## Physical interface name option 'ifname' 'tun-example' - # option 'max_rtt_penalty' '90' + ## Specify the type of interface: tunnels use the RTT-based metric. + option 'type' 'tunnel' + ## Other options that can be overriden. + # option 'max_rtt_penalty' '96' # A config interface without "option ifname" will set default options # for all interfaces. Interface-specific configuration always overrides @@ -49,27 +54,49 @@ config interface # option 'update_interval' '30' -# A filter consists of a type ('in', 'out' or 'redistribute'), an action -# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq', -# etc.). See babeld man page ("Filtering rules") for more details. -# Here is a sample filter wich redistributes the default route if its -# protocol number is "boot", e.g. when it installed by dhcp. It is -# disabled by default. +# A filter consists of a type ('in', 'out', 'redistribute' or 'install'), +# a set of selectors ('ip', 'eq', etc.) and a set of actions to perform +# ('allow', 'deny', 'metric xxx', 'src-prefix xxx', 'table xxx', 'pref-src xxx'). +# See babeld man page ("Filtering rules") for more details. + +# Below is a sample filter that redistributes the default route if its +# protocol number is "boot", e.g. when it is installed by dhcp (see +# /etc/iproute2/rt_protos). This filter is disabled thanks to the 'ignore' +# setting. config filter option 'ignore' 'true' - # Type + # Type of filter option 'type' 'redistribute' # Selectors: ip, eq, le, ge, src_ip, src_eq, src_le, src_ge, neigh, id, # proto, local, if. option 'ip' '0.0.0.0/0' option 'eq' '0' option 'proto' '3' - # Action (one of: allow, deny, metric XXX, src-prefix XXX). + # Action, which can be any of: allow, deny, metric , src-prefix , + # table , pref-src . + # The action defaults to "allow" if not specified. Here, we specify a higher + # redistribution metric than the default (0). option 'action' 'metric 128' -# Notice that the 'local' selector is a boolean. +# Another example filter: don't redistribute local addresses in a certain IP prefix. +# By default, babeld redistributes *all* local addresses. config filter option 'ignore' 'true' option 'type' 'redistribute' + # Only apply to routes/addresses within this prefix. + option 'ip' '198.51.100.0/24' + # Notice that the 'local' selector is a boolean. option 'local' 'true' - # No action means "allow" + # Don't redistribute. + option 'action' 'deny' + +# Example install filter, to change or filter routes before they are inserted +# into the kernel. +config filter + option 'ignore' 'true' + option 'type' 'install' + # Optional: only apply to routes within 2001:db8:cafe::/48 + option 'ip' '2001:db8:cafe::/48' + # We specify the kernel routing table and the preferred source address to use for these routes. + # "Allow" is implicit. + option 'action' 'table 200 pref-src 2001:db8:ba:be1::42'