diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-10-30 16:54:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-30 16:54:59 -0400 |
| commit | 95efa72fd89c655b193316b7ef854749d99f88c2 (patch) | |
| tree | 855fcd28b602eacbbbbe4612c22749b38ab55655 /ospf6d/ospf6_interface.c | |
| parent | bc534e9dc1ef2df0d37543e86e82587a57eb630f (diff) | |
| parent | b9470c1b2b3dd9e71292076bc494cb8788856080 (diff) | |
Merge pull request #14687 from opensourcerouting/fix/backport_14635_9.0
ospf6d: Set loopback interface cost to 0
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 0fb3d29e25..36680ea87b 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -128,9 +128,19 @@ static uint8_t ospf6_default_iftype(struct interface *ifp) static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi) { /* If all else fails, use default OSPF cost */ - uint32_t cost; + uint32_t cost = 0; uint32_t bw, refbw; 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, * use ospf default bw. If bw is configured then it would * be used. |
