Skip to content

Commit

Permalink
ospf6d: Set loopback interface cost to 0
Browse files Browse the repository at this point in the history
https://www.rfc-editor.org/rfc/rfc5340.html#page-37 states:

If the interface type is point-
      to-multipoint or the interface is in the state Loopback, the
      global scope IPv6 addresses associated with the interface (if any)
      are copied into the intra-area-prefix-LSA with the PrefixOptions
      LA-bit set, the PrefixLength set to 128, and the metric set to 0.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Oct 23, 2023
1 parent e1c119b commit fa3140f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ospf6d/ospf6_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
cost = 1;
}

/* If the interface type is point-to-multipoint or the interface
* is in the state Loopback, the global scope IPv6 addresses
* associated with the interface (if any) are copied into the
* intra-area-prefix-LSA with the PrefixOptions LA-bit set, the
* PrefixLength set to 128, and the metric set to 0.
*/
if (if_is_loopback(oi->interface))
cost = 0;

return cost;
}

Expand Down

0 comments on commit fa3140f

Please sign in to comment.