[dhcpmon] Use NULL for DB result pointers - #106
Closed
Xichen96 wants to merge 1 commit into
Closed
Conversation
Align the four DHCPv4/v6 counter initialization checks from PR sonic-net#62 with the daemon's existing pointer style. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 39f979be-d826-4d5c-949a-f20abb58bb83 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR is a small style-only cleanup in sonic-dhcpmon that aligns CONFIG_DB hget() result pointer checks in the DHCP monitor with the project’s established NULL-based null-check convention.
Changes:
- Replaced four
nullptrcomparisons withNULLindb_counters_initialized()for RX/TX counter existence checks (v4 and v6). - No behavioral changes intended; only pointer-style consistency.
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Xichen96
marked this pull request as ready for review
July 31, 2026 17:58
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
|
Closing because its four nullptr-to-NULL consistency changes are now folded into #96 with the other small hardening cleanups. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Replace four
nullptrcomparisons introduced by merged PR #62 withNULLtomatch the existing sonic-dhcpmon pointer style.
Type of change
Approach
What is the motivation for this PR?
The surrounding daemon consistently uses
NULL; these four checks were theremaining style outliers from the DHCPv6 monitoring change.
How did you do it?
Changed only the four CONFIG_DB result pointer comparisons. There is no
behavioral change.
How did you verify/test it?
Azure PR CI only; no local compilation.
Any platform specific information?
No.
Back port request
None. This targets master only.
Documentation
Not applicable.
Review
Review the single commit:
51ba2fd [dhcpmon]: Use NULL for DB result pointers