lib: also compare rmap source address when comparing nexthop source a…#21233
lib: also compare rmap source address when comparing nexthop source a…#21233riw777 merged 1 commit intoFRRouting:masterfrom
Conversation
…ddresses Fix FRRouting#19611 Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
Greptile SummaryThis PR fixes issue #19611 by including the
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["_nexthop_cmp_no_labels / nexthop_cmp_basic"] --> B{vrf_id equal?}
B -- no --> Z[return diff]
B -- yes --> C{type equal?}
C -- no --> Z
C -- yes --> D{weight/ifindex/gateway equal?}
D -- no --> Z
D -- yes --> E{srte_color equal?}
E -- no --> Z
E -- yes --> F["🆕 rmap_src compare\n(_nexthop_rmap_source_cmp)"]
F -- not equal --> Z
F -- equal --> G["src compare\n(_nexthop_source_cmp)"]
G -- not equal --> Z
G -- equal --> H[compare labels / backup indices]
H --> I[return result]
Prompt To Fix All With AIThis is a comment left during a code review.
Path: lib/nexthop.c
Line: 148-149
Comment:
**Parameter alignment is off in new function signature**
The second parameter of `_nexthop_rmap_source_cmp` is indented with the same whitespace as in `_nexthop_source_cmp`, but because the new function name is 5 characters longer, the second parameter no longer aligns with the opening parenthesis of the parameter list. With 8-space tabs, `const struct nexthop *nh1` begins at column 36, but `const struct nexthop *nh2` begins at column 31.
```suggestion
static int _nexthop_rmap_source_cmp(const struct nexthop *nh1,
const struct nexthop *nh2)
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "lib: also compare rm..." |
| static int _nexthop_rmap_source_cmp(const struct nexthop *nh1, | ||
| const struct nexthop *nh2) |
There was a problem hiding this comment.
Parameter alignment is off in new function signature
The second parameter of _nexthop_rmap_source_cmp is indented with the same whitespace as in _nexthop_source_cmp, but because the new function name is 5 characters longer, the second parameter no longer aligns with the opening parenthesis of the parameter list. With 8-space tabs, const struct nexthop *nh1 begins at column 36, but const struct nexthop *nh2 begins at column 31.
| static int _nexthop_rmap_source_cmp(const struct nexthop *nh1, | |
| const struct nexthop *nh2) | |
| static int _nexthop_rmap_source_cmp(const struct nexthop *nh1, | |
| const struct nexthop *nh2) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/nexthop.c
Line: 148-149
Comment:
**Parameter alignment is off in new function signature**
The second parameter of `_nexthop_rmap_source_cmp` is indented with the same whitespace as in `_nexthop_source_cmp`, but because the new function name is 5 characters longer, the second parameter no longer aligns with the opening parenthesis of the parameter list. With 8-space tabs, `const struct nexthop *nh1` begins at column 36, but `const struct nexthop *nh2` begins at column 31.
```suggestion
static int _nexthop_rmap_source_cmp(const struct nexthop *nh1,
const struct nexthop *nh2)
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…ddresses
Fix #19611