Import routes installed by other software as HNAs - #140
Open
mkg20001 wants to merge 2 commits into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.