zebra: fix wrong comparision for nexthop#21503
zebra: fix wrong comparision for nexthop#21503anlancs wants to merge 1 commit intoFRRouting:masterfrom
Conversation
By accident, i found the "same" field in log of the nexthop was actually opposite. Regardless of whether it is active or not, "same" field should be true. Before: ``` ZEBRA: [M8H8E-HFGSQ] zebra_nhg_nexthop_compare: 3.3.3.3/32 Comparing via 192.168.0.1, enp2s0(1) ACTIVE: 1 to old: via 192.168.0.1, enp2s0(3) ACTIVE: 1 nexthop same: 0 ``` After: ``` ZEBRA: [M8H8E-HFGSQ] zebra_nhg_nexthop_compare: 3.3.3.3/32 Comparing via 192.168.0.1, enp2s0(1) ACTIVE: 1 to old: via 192.168.0.1, enp2s0(3) ACTIVE: 1 nexthop same: 1 ``` And this commit should affect the scenarios where `nexthop_same_no_ifindex` is introduced. Signed-off-by: anlan_cs <[email protected]>
Greptile SummaryThis PR fixes an inverted boolean return in Confidence Score: 5/5This PR is safe to merge — it is a correct, minimal one-line bug fix with no side effects. The change fixes a clear boolean-inversion bug (comparator returning 0-for-equal being cast to bool) in a single line, consistent with the established pattern in sibling functions No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "zebra: fix wrong comparision for nexthop" | Re-trigger Greptile |
By accident, i found the "same" field in log of the nexthop was actually opposite. Regardless of whether it is active or not, "same" field should be true.
Before:
After:
And this commit should affect the scenarios where
nexthop_same_no_ifindexis introduced.