Skip to content

gnrc/ipv6/nib: clean up gnrc_ipv6_nib_get_next_hop_l2addr()#21454

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:gnrc_ipv6_nib_get_next_hop_l2addr-cleanup
Jul 24, 2025
Merged

gnrc/ipv6/nib: clean up gnrc_ipv6_nib_get_next_hop_l2addr()#21454
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:gnrc_ipv6_nib_get_next_hop_l2addr-cleanup

Conversation

@benpicco
Copy link
Copy Markdown
Contributor

Contribution description

gnrc_ipv6_nib_get_next_hop_l2addr() has a rather high code complexity which makes it hard to understand and easy to introduce errors.

Reduce the amount of nested if branches to make the function easier to understand.

This should contain no functional / logic changes.

Testing procedure

Issues/PRs references

@benpicco benpicco changed the title gnrc/ipv6/nib: clean up gnrc_ipv6_nib_get_next_hop_l2addr() gnrc/ipv6/nib: clean up gnrc_ipv6_nib_get_next_hop_l2addr() Apr 29, 2025
@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Apr 29, 2025
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 29, 2025
@benpicco benpicco requested a review from fabian18 April 29, 2025 17:01
@riot-ci
Copy link
Copy Markdown

riot-ci commented Apr 29, 2025

Murdock results

✔️ PASSED

80cfb41 gnrc/ipv6/nib: clean up gnrc_ipv6_nib_get_next_hop_l2addr()

Success Failures Total Runtime
10337 0 10337 11m:18s

Artifacts

@crasbe crasbe added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Apr 29, 2025
@benpicco benpicco force-pushed the gnrc_ipv6_nib_get_next_hop_l2addr-cleanup branch from d8c2194 to 6985ccc Compare April 30, 2025 16:12
@benpicco benpicco requested a review from maribu May 7, 2025 12:18
Copy link
Copy Markdown
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that this is mostly replacing the break; used as hidden goto with a non-hidden goto?

The default diff tool used by Github is doing a really poor job on indent changes, matching unrelated } lines that now due to the indent change happen to be on the same line.

@benpicco benpicco force-pushed the gnrc_ipv6_nib_get_next_hop_l2addr-cleanup branch from 6985ccc to 80cfb41 Compare May 7, 2025 14:16
Copy link
Copy Markdown
Contributor

@Teufelchen1 Teufelchen1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is indeed very hard to read in the github diff.

@benpicco benpicco added this pull request to the merge queue Jul 24, 2025
Merged via the queue into RIOT-OS:master with commit cdfdd21 Jul 24, 2025
26 checks passed
@benpicco benpicco deleted the gnrc_ipv6_nib_get_next_hop_l2addr-cleanup branch July 25, 2025 10:27
@benpicco benpicco added this to the Release 2025.10 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants