From 3bc82a966b8ad85a0cd50cbe0df720f044460e50 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 8 Jul 2026 20:17:05 -0700 Subject: [PATCH] [ip6] adhere to style guide for var declarations in `HandleDatagram()` (#13320) This is a small style guide fix in `Ip6::HandleDatagram()`, ensuring all scoped stack variable declarations are placed together at the top of the enclosing scope in which they are used. --- src/core/net/ip6.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index 0ef583c43..db206c612 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -1267,15 +1267,15 @@ exit: Error Ip6::HandleDatagram(OwnedPtr aMessagePtr, bool aIsReassembled, uint8_t aRecursionDepth) { - Error error; - Header header; - - VerifyOrExit(aRecursionDepth <= kMaxRecursionDepth, error = kErrorDrop); + Error error; + Header header; bool receive; bool forwardThread; bool forwardHost; uint8_t nextHeader; + VerifyOrExit(aRecursionDepth <= kMaxRecursionDepth, error = kErrorDrop); + SuccessOrExit(error = header.ParseFrom(*aMessagePtr)); if (!aMessagePtr->IsOriginHostTrusted())