mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-01 07:26:05 +00:00
ospf6d: Set loopback interface cost to 0
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 <donatas@opensourcerouting.org>
This commit is contained in:
parent
e8615867d0
commit
80dfa9e012
@ -128,9 +128,19 @@ static uint8_t ospf6_default_iftype(struct interface *ifp)
|
|||||||
static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
|
static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
|
||||||
{
|
{
|
||||||
/* If all else fails, use default OSPF cost */
|
/* If all else fails, use default OSPF cost */
|
||||||
uint32_t cost;
|
uint32_t cost = 0;
|
||||||
uint32_t bw, refbw;
|
uint32_t bw, refbw;
|
||||||
struct ospf6 *ospf6;
|
struct ospf6 *ospf6;
|
||||||
|
|
||||||
|
/* 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))
|
||||||
|
return cost;
|
||||||
|
|
||||||
/* interface speed and bw can be 0 in some platforms,
|
/* interface speed and bw can be 0 in some platforms,
|
||||||
* use ospf default bw. If bw is configured then it would
|
* use ospf default bw. If bw is configured then it would
|
||||||
* be used.
|
* be used.
|
||||||
|
Loading…
Reference in New Issue
Block a user