diff options
author | Chirag Shah <chirag@cumulusnetworks.com> | 2018-08-25 00:15:36 +0200 |
---|---|---|
committer | Chirag Shah <chirag@cumulusnetworks.com> | 2018-08-25 00:26:42 +0200 |
commit | 96065dc3104a2f2dcfc2e7defd13a61662bd597e (patch) | |
tree | 9b50a1e60386bb78f4190bb50d2d5079ffdbbdde /ospfd/ospf_zebra.c | |
parent | Merge pull request #2891 from opensourcerouting/logging-docs (diff) | |
download | frr-96065dc3104a2f2dcfc2e7defd13a61662bd597e.tar.xz frr-96065dc3104a2f2dcfc2e7defd13a61662bd597e.zip |
ospfd: interface speed change during intf add
The problem is seen where speed mismatch caused ECMP route
not being reflected with correct number paths (NHs).
During cold boot, some interface speed updated by zebra as
part of one shot timer and triggers interface add to clients.
In this case, ospf already have created interface (bond interface),
but speed was not updated, trigger to do interface speed change
as part of interface add, which will trigger all Router LSA to
use updated speed into cost calculation.
Ticket:CM-22170
Testing Done:
Bring up CLOS config with Spine and leafs. Leaf have CLAG pair,
with same VRR ip address.
At spine one of the bond connecting to leaf node was having
higher speed than the paired device, With this fix, at spine (DUT)
bond interface speed is equal from all peer nodes.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r-- | ospfd/ospf_zebra.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 0a7776cce..8c94a8ef9 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -111,10 +111,11 @@ static int ospf_interface_add(int command, struct zclient *zclient, if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE)) zlog_debug( - "Zebra: interface add %s vrf %s[%u] index %d flags %llx metric %d mtu %d", + "Zebra: interface add %s vrf %s[%u] index %d flags %llx metric %d mtu %d speed %u", ifp->name, ospf_vrf_id_to_name(ifp->vrf_id), ifp->vrf_id, ifp->ifindex, - (unsigned long long)ifp->flags, ifp->metric, ifp->mtu); + (unsigned long long)ifp->flags, ifp->metric, ifp->mtu, + ifp->speed); assert(ifp->info); @@ -128,6 +129,8 @@ static int ospf_interface_add(int command, struct zclient *zclient, if (!ospf) return 0; + ospf_if_recalculate_output_cost(ifp); + ospf_if_update(ospf, ifp); hook_call(ospf_if_update, ifp); @@ -448,14 +451,17 @@ void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *p, count++; if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) { - char buf[2][PREFIX2STR_BUFFER]; + char buf[2][INET_ADDRSTRLEN]; + struct interface *ifp; + + ifp = if_lookup_by_index(path->ifindex, ospf->vrf_id); zlog_debug( - "Zebra: Route add %s nexthop %s, ifindex=%d", + "Zebra: Route add %s nexthop %s, ifindex=%d %s", prefix2str(p, buf[0], sizeof(buf[0])), inet_ntop(AF_INET, &path->nexthop, buf[1], sizeof(buf[1])), - path->ifindex); + path->ifindex, ifp ? ifp->name : " "); } } api.nexthop_num = count; |