You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit simplifies the `Ip6::DetermineAction()` method, which
determines the appropriate actions (`forwardThread`, `forwardHost`,
`receive`) for an IPv6 message based on its destination address and
origin.
- The code now uses `ExitNow()` to exit the method as soon as a
specific action is determined. This avoids deeply nested `if/else`
blocks and makes the control flow easier to understand.
- Some negative conditional checks have been refactored into positive
checks with early exits. For example, a condition like `if
(!cond1 || !cond2)` that guarded further processing is now
expressed as `if (cond1 && cond2) { ExitNow(); }`, making the logic
more direct.
- New comments have been added to clarify more complex checks and
conditions within the method.
- The `RouteLookup()` method has been removed and its logic inlined
directly into `DetermineAction()`. This improves code readability
and allows for clearer distinction between forwarding to a host due
to Border Router functionality versus forwarding as a last resort
when no specific route exists.
0 commit comments