HomeFreeBSD

routing: add abitity to set the protocol that installed route/nexthop.

Description

routing: add abitity to set the protocol that installed route/nexthop.

Routing daemons such as bird need to know if they install certain route
so they can clean it up on startup, as a form of achieving consistent
state during the crash recovery.
Currently they use combination of routing flags (RTF_PROTO1) to detect
these routes when interacting via route(4) rtsock protocol.
Netlink protocol has a special "rtm_protocol" field that is filled and
checked by the route originator. To prepare for the upcoming netlink
introduction, add ability to record origing to both nexthops and
nexthop groups via <nhop|nhgrp>_<get|set>_origin() KPI. The actual
calls will be used in the followup commits.

MFC after: 1 month

Details

Provenance
melifaroAuthored on Sep 8 2022, 9:05 AM
Parents
rGbab32a8029c3: arm64, riscv: size boot stacks appropriately
Branches
Unknown
Tags
Unknown