Tidy the export limits, passive peers and status page code

Readability, no change in behaviour, but for one log line:

- The routes a peer holds from us were counted twice over, differently,
  in the exporter: once per learned-route batch and once per originated
  route. Learned::held_by_peer counts the learned ones in one place, and
  ExportLimits::exceeded_by returns the limit that was passed instead of a
  bool, so that ending the session no longer has to dig it out again with
  a default that could not happen.
- The two hold-downs for a limit passed, ours or the peer's, were two
  near-identical blocks; they are one match.
- How a session ended is put into words in one place
  (SessionEnd::reason), for the dialer's backoff and the passive peer's
  state alike.
- parse_export_limits parses one block; what a missing block means (no
  limits at the top, the top's limits for a peer) is said where it
  differs, instead of Option in and Option out.
- The startup warnings about export limits are a function of their own,
  and the peers without limits are named in one line rather than one
  line each: a router with eighty sessions does not need eighty warnings.
  The warning about a peer without a role is gone: the configuration now
  refuses one.
- Hex formatting of attribute octets is one function; the text for an
  unknown attribute is built in three plain steps.
- The exporter's test fixture returns a named struct, not a tuple.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Rayhaan JaufeerallyandClaude Fable 5.1 committed 2026-10-06 10:05:31 +02:00
1 parent 2dfc00862b
commit befc292215
9 files changed
+219 -214

No files matched your search

@@ -143,9 +143,9 @@ in hold-down for the neighbor's `import.hold_down_seconds` (default: 600
seconds). Set `max_prefixes` somewhat above the number of routes that the
local AS and its customers originate.
At startup, Ferrix logs a warning for each neighbor to which export limits
apply but none are configured, and for each originated route that the
`prefixes` of the export limits do not permit.
At startup, Ferrix logs a warning that lists the neighbors to which export
limits apply but none are configured, and a warning for each originated
route that the `prefixes` of the export limits do not permit.
### Verifying Export Limits