Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions net/babeld/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2007-2021 OpenWrt.org
#

include $(TOPDIR)/rules.mk

PKG_NAME:=babeld
PKG_VERSION:=1.13.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads-up rather than a defect: this feed's CI runs a generic runtime check that executes each installed binary with version/help flags and expects PKG_VERSION in the output — the routing feed doesn't run that, so it's new surface for this package.

Two things make it worth a look before merge: babeld's own option parser is short-option based, and 600-add-ubus.patch rewrites generate-version.sh to emit "$version-ubus-mod". The suffix itself is harmless (1.13.1-ubus-mod still contains 1.13.1), but if $version resolves to unknown when building from the release tarball rather than a git checkout, the printed string won't contain 1.13.1 at all. If the check doesn't pass, the fix is a net/babeld/test-version.sh that returns 0 for this package. The multi-arch jobs were still queued when I looked, so I couldn't confirm either way.


Generated by Claude Code

PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/
PKG_HASH:=15f24d26da0ccfc073abcdef0309f281e4684f2aa71126f826572c4c845e8dd9

PKG_MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info>, \
Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>, \
Nick Hainke <vincent@systemli.org>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENCE

include $(INCLUDE_DIR)/package.mk

define Package/babeld
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
TITLE:=A loop-avoiding distance-vector routing protocol
URL:=https://www.irif.fr/~jch/software/babel/
DEPENDS:=@IPV6 +libubus +libubox
endef

define Package/babeld/description
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 an IETF standard protocol (RFC 8966).
endef

define Package/babeld/conffiles
/etc/babeld.conf
/etc/config/babeld
endef

MAKE_FLAGS+= \
CFLAGS="$(TARGET_CFLAGS)" \
LDLIBS="-lubus -lubox"

define Package/babeld/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/babeld.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld
endef

$(eval $(call BuildPackage,babeld))
38 changes: 38 additions & 0 deletions net/babeld/files/babeld.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# babel config file
#
# This config file simply documents sample entries.
# "redistribute" means: redistribute routes from other routing protocols
# into babel. "local" means addresses assigned to local interfaces.
#
# You do not need to edit this file: you can use /etc/config/babeld
# instead (sections "interface" and "filter"). Both files can be used
# simultaneously (the rules of this file are executed first).

# the default rules are:
#
## redistribute local
## redistribute deny
#
# this says, redistribute local addresses but no other routes


# redistribute IPv4 default route into babel
## redistribute local ip 0.0.0.0/0 le 0 metric 128

# same but for IPv6
## redistribute local ip ::/0 le 0 metric 128


# don't redistribute all local addresses, only selected ones
# after the first line, the "deny" rules kicks in. After the "deny"
# no redistribute local rules are going to match
## redistribute local ip 192.160.4.0/24
## redistribute local deny


# Babel refuses to redistribute routes with a protocol number of "boot";
# this is standard practice, and means that you cannot easily
# redistribute the default route installed by dhcp. It is however
# possible to redistribute such route by explicitly specifying "proto 3"
# on the redistribute line.
## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128
103 changes: 103 additions & 0 deletions net/babeld/files/babeld.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
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),
# - *.conf files in the directory defined by conf_dir (default: /tmp/babel.d/),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the documented default directory disagrees with the init script. babeld.init:10 sets OTHERCONFIGDIR="/tmp/babeld.d/" (with a d), so a user who follows this comment and drops *.conf files into /tmp/babel.d/ gets them silently ignored. The init script is the authority here, so the comment is the side to fix:

Suggested change
# - *.conf files in the directory defined by conf_dir (default: /tmp/babel.d/),
# - *.conf files in the directory defined by conf_dir (default: /tmp/babeld.d/),

Same typo on line 26 below (# option 'conf_dir' '/tmp/babel.d/').


Generated by Claude Code

# - this UCI configuration file.

# See "man babeld" for all available options ("Global options").
# Important: remember to use '_' instead of '-' in option names.
config general
# option 'random_id' 'true'
# option 'debug' '1'
# option 'local_port' '33123'
# option 'log_file' '/var/log/babeld.log'
## Enable ipv6-subtrees by default since OpenWrt should ship with a
## recent enough kernel for it to work.
option 'ipv6_subtrees' 'true'
# list 'import_table' '42'
# list 'import_table' '100'
## Alternative configuration file and directory.
## See comment at the top of this file for more details.
# option 'conf_file' '/etc/babeld.conf'
# option 'conf_dir' '/tmp/babel.d/'
# option 'ubus_bindings' 'false'

config interface
## Remove this line to enable babeld on this interface
option 'ignore' 'true'
## You can use aliases (like lan, wlan) or real names (like eth0.0).
## If you use an alias, it must be already defined when babeld starts.
## Otherwise, the name is taken literally and the interface can be
## brought up later (useful for tunnels for instance).
option 'ifname' 'wlan'
## You can set options, see babeld man page ("Interface configuration")
# option 'rxcost' '256'
# option 'hello_interval' '1'

config interface
option 'ignore' 'true'
## Physical interface name
option 'ifname' 'tun-example'
## 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
# default configuration.
config interface
# option 'enable_timestamps' 'true'
# option 'update_interval' '30'


# 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 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, which can be any of: allow, deny, metric <NUMBER>, src-prefix <PREFIX>,
# table <ID>, pref-src <IP>.
# The action defaults to "allow" if not specified. Here, we specify a higher
# redistribution metric than the default (0).
option 'action' 'metric 128'

# 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'
# 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'
Loading