Skip to content

Import routes installed by other software as HNAs - #140

Open
mkg20001 wants to merge 2 commits into
OLSR:masterfrom
ffgraz:route-import
Open

Import routes installed by other software as HNAs#140
mkg20001 wants to merge 2 commits into
OLSR:masterfrom
ffgraz:route-import

Conversation

@mkg20001

Copy link
Copy Markdown

Announce host routes some other software put in the kernel as olsr HNAs, so addresses olsr has no other way of learning about become reachable from the olsr side. The source is named by its route protocol: another routing daemon, a roaming or tunnel manager, anything installing routes under a protocol of its own. Without it the olsr side hears no route to those hosts, so the border NAT has nothing to send replies back to.

ImportProto names the protocol, 0 (the default) disables it. An optional repeatable ImportPrefix bounds what may be announced; without one, every host route of that protocol is taken, transfer networks and management addresses included. Only host routes qualify, so a default route or an aggregate can never become an HNA.

The startup dump reads until NLMSG_DONE, since a table dump spans as many datagrams as it needs. An address already in the list is skipped, or software that rewrites a route on every metric change would grow the list without bound. Route multicast is subscribed only when ImportProto is set. rtnetlink_read() sizes its buffer from a peek instead of a fixed 4096: route messages carry more attributes than link messages.

test/route-import.sh drives the daemon in a throwaway netns - olsrd has no C test harness to hook into.

mkg20001 and others added 2 commits August 30, 2026 06:23
Announce host routes some other software put in the kernel as olsr HNAs,
so addresses olsr has no other way of learning about become reachable
from the olsr side. The source is named by its route protocol: another
routing daemon, a roaming or tunnel manager, anything installing routes
under a protocol of its own. Without it the olsr side hears no route to
those hosts, so the border NAT has nothing to send replies back to.

ImportProto names the protocol, 0 (the default) disables it. An optional
repeatable ImportPrefix bounds what may be announced; without one, every
host route of that protocol is taken, transfer networks and management
addresses included. Only host routes qualify, so a default route or an
aggregate can never become an HNA.

The startup dump reads until NLMSG_DONE, since a table dump spans as
many datagrams as it needs. An address already in the list is skipped,
or software that rewrites a route on every metric change would grow the
list without bound. Route multicast is subscribed only when ImportProto
is set. rtnetlink_read() sizes its buffer from a peek instead of a fixed
4096: route messages carry more attributes than link messages.

test/route-import.sh drives the daemon in a throwaway netns - olsrd has
no C test harness to hook into.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The DEF_IMPORTPROTO define and its two config-default assignments each
landed twice. Harmless, but only by luck.

test/route-import.sh now runs its whole case set for both families, so
the IPv6 filter and RTMGRP_IPV6_ROUTE subscription are actually covered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PC13y4JFh4V3iopRytjjJd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant