Fix MAC encoding, port range, data race, and ZMQ message ID bugs - #168
Merged
Conversation
synfinatic
commented
Jun 20, 2026
Owner
- MAC addresses were encoded with PutUvarint (LEB128) instead of BigEndian, corrupting every MAC field for real hardware addresses
- Port parsing used bitSize=16, silently rejecting ports 32768-65535
- health check handler read collecting bool from an HTTP goroutine while main wrote it without synchronization; switched to atomic.Bool
- jcompress format fell through to json case and logged a misleading second "Using ntopng JSON format" line; guarded with if !compress
- ZMQ messageId started at 0, so the "Sending first ZMQ message" log fired on the second send; initialized to 1 to match the == 1 check
- ZMQ wrap-around reset was in an else-if chain and could be skipped; made it an independent if statement
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](docker/metadata-action@v5...v6) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@v3...v4) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 7. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5...v7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #168 +/- ##
==========================================
+ Coverage 0.00% 72.42% +72.42%
==========================================
Files 7 7
Lines 668 689 +21
==========================================
+ Hits 0 499 +499
+ Misses 668 161 -507
- Partials 0 29 +29
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
- MAC addresses were encoded with PutUvarint (LEB128) instead of BigEndian, corrupting every MAC field for real hardware addresses - Port parsing used bitSize=16, silently rejecting ports 32768-65535 - health check handler read collecting bool from an HTTP goroutine while main wrote it without synchronization; switched to atomic.Bool - jcompress format fell through to json case and logged a misleading second "Using ntopng JSON format" line; guarded with if !compress - ZMQ messageId started at 0, so the "Sending first ZMQ message" log fired on the second send; initialized to 1 to match the == 1 check - ZMQ wrap-around reset was in an else-if chain and could be skipped; made it an independent if statement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MAC encoding: TestExtractFlowData_MAC + _HighBits test BigEndian encoding in extractFlowData; TestNtopngJson_toJSON_MAC checks both src and dst; TestNtopngTlv_toTLV_MAC verifies string output in TLV - Port range: TestAddress_Value_HighPorts confirms ports 32768–65535 are now accepted (were rejected with bitSize=16); _OutOfRangePorts checks bounds enforcement at 0 and 65536 - jcompress double-log: TestSelectFormat_JCompress_SingleLog verifies exactly one log line is emitted and it's the compressed-format message - atomic.Bool health handler: existing TestNewHealthHandler_* tests already exercise the atomic.Bool path added for the data race fix - ZMQ messageId: existing TestZmqDriver_Send_MessageIdLogging and TestZmqDriver_Send_MsgIdWrap integration tests cover the off-by-one initialization and wrap-around fixes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- recover() return discarded with _ = recover() in both formatters
- w.Close() and io.Copy() in cmd tests now checked for errors
- defer r.Close() and defer sub.Close() wrapped in func() { _ = ... }()
- sub.Connect, sub.SetSubscribe, d.Init, sub.SetRcvtimeo calls in zmq
integration tests now checked with t.Fatalf on error
- sub.RecvBytes(0) header-skip uses _, _ = to silence errcheck
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.