implement local binding, rfc-based tests, fix deficiencies, add CI

This commit is contained in:
ktims committed 2026-10-27 15:04:50 -07:00
1 parent 8962406c57
commit 2b2fe66785
17 files changed
+3076 -1491

No files matched your search

+25 -17
View File
@@ -1,18 +1,9 @@
# rust-bfd configuration. Install as /etc/rust-bfd/config.yaml (or pass --config / set BFD_CONFIG).
# rust-bfd configuration. Install as /etc/rust-bfd/config.yaml, or select another file with --config / BFD_CONFIG.
# This file is the only way to configure the daemon.
#
# Precedence, lowest to highest: built-in defaults < this file < BFD_* environment < command line.
# Values shown below are the built-in defaults unless noted. Unknown keys are an error.
# Local address(es) to bind and use as the source of BFD control packets. Required (here, in BFD_BIND, or via --bind).
# Accepts a single address, a list, or a comma-separated string. The daemon currently supports exactly one address;
# the list form is accepted so configs do not need to change once multiple binds are implemented.
# Env: BFD_BIND="192.0.2.1" (or "192.0.2.1,2001:db8::1")
# CLI: --bind 192.0.2.1 [--bind ...] (replaces the addresses configured here)
bind: 192.0.2.1
# bind: [192.0.2.1, "2001:db8::1"]
# Directory of executable scripts run, in lexical order, on every session state change.
# Env: BFD_HOOKS_DIR
hooks_dir: /etc/rust-bfd/hooks.d
# Settings inherited by every peer that does not override them. Durations are humantime strings (300ms, 1s, 2m).
@@ -20,22 +11,36 @@ hooks_dir: /etc/rust-bfd/hooks.d
defaults:
# Minimum interval between transmitted control packets that we would like to use once the session is Up. Sessions
# that are not Up transmit no faster than once per second regardless (RFC 5880 section 6.8.3).
# Env: BFD_DEFAULTS_DESIRED_MIN_TX
desired_min_tx: 300ms
# Minimum interval between received control packets we can support.
# Env: BFD_DEFAULTS_REQUIRED_MIN_RX
required_min_rx: 300ms
# Detection time multiplier: we declare the session down after this many missed packets.
# Env: BFD_DEFAULTS_DETECT_MULT
detect_mult: 3
# Peers to establish sessions with. Peers can only be configured here and with --peer (repeatable, addresses only,
# default settings); they cannot be set from the environment. Each peer's address must match the family of at least
# one bind address.
# Peers to establish sessions with.
#
# `local` is required: the local address the session runs from, which is the source of its control packets and the
# address the daemon listens on for the peer's. It must be of the same address family as `address`. The daemon listens
# on each distinct `local` address (and `interface`, below) once, however many peers use it; peers may use different
# local addresses.
#
# `interface` optionally binds the session's sockets to one interface (SO_BINDTODEVICE). It is required when `local` or
# `address` is an IPv6 link-local address (fe80::/10), which is only meaningful on a given link. The same peer address
# may be configured on several interfaces. The binding is to the interface as it exists at startup: if it is
# recreated, the daemon must be restarted.
peers:
- address: 192.0.2.2
local: 192.0.2.1
# - address: 2001:db8::2
# local: "2001:db8::1"
#
# - address: "fe80::2"
# local: "fe80::1"
# interface: eth1
#
# Per-peer overrides of any `defaults` key:
# - address: 192.0.2.3
# local: 192.0.2.1
# desired_min_tx: 1s
# required_min_rx: 1s
# detect_mult: 5
@@ -51,6 +56,7 @@ peers:
# Keyed MD5: `key` is exactly 16 bytes. `meticulous` (default true) selects Meticulous Keyed MD5, in which every
# packet must carry a newer sequence number; the remote must be set to the same mode.
# - address: 192.0.2.4
# local: 192.0.2.1
# auth:
# type: md5
# key_id: 1
@@ -59,6 +65,7 @@ peers:
#
# Keyed SHA1: `key` is exactly 20 bytes. `meticulous` as above.
# - address: 192.0.2.5
# local: 192.0.2.1
# auth:
# type: sha1
# key_id: 1
@@ -66,6 +73,7 @@ peers:
#
# Simple password: 1 to 16 bytes, sent in the clear. Provides no protection against an attacker on the path.
# - address: 192.0.2.6
# local: 192.0.2.1
# auth:
# type: password
# key_id: 1