feat: state the device's own address in origin.ip - #42
Merged
Conversation
The ip PARAM, sourced from the same interface address HOSTNAME reports. A relay or NAT between device and collector rewrites what the collector observes; ip is what the device says about itself, which survives the hop. Flash +12,388 B (+408 on the previous stage) RAM +7,384 B (unchanged) Log stack +712 B (+8) Service +992 B (unchanged) ip is repeatable per RFC 5424 section 7.2, so the library asks for a count and then one value per index rather than taking a string. This device has one address and returns one, and none before the interface has an address. SyslogFields_IpAddress is now the single place that reads the address; HOSTNAME formats the same string through it. The record is 260 bytes, inside the 512-byte cap with room for both counters at full width. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe syslog implementation now derives the default interface IPv4 address through a shared helper and emits it as the ChangesOrigin IP emission
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/syslog/SyslogFields.c`:
- Around line 42-44: Update SyslogFields_IpAddress to return immediately when
out is NULL or size is zero, before accessing out[0]; preserve the existing
empty-string initialization for valid buffers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e84b1287-159a-40e6-9044-72ab40bfab06
⛔ Files ignored due to path filters (2)
measurements/origin-ip.csvis excluded by!**/*.csvmeasurements/stages.tsvis excluded by!**/*.tsv
📒 Files selected for processing (5)
README.mdapp/syslog/Syslog.capp/syslog/SyslogFields.capp/syslog/SyslogFields.hrun-report.md
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.
Pull request
What this stage adds
The ip PARAM, sourced from the same interface address HOSTNAME reports. A relay or
NAT between device and collector rewrites what the collector observes; ip is what
the device says about itself, which survives the hop.
Flash +12,388 B (+408 on the previous stage)
RAM +7,384 B (unchanged)
Log stack +712 B (+8)
Service +992 B (unchanged)
ip is repeatable per RFC 5424 section 7.2, so the library asks for a count and then
one value per index rather than taking a string. This device has one address and
returns one, and none before the interface has an address.
SyslogFields_IpAddress is now the single place that reads the address; HOSTNAME
formats the same string through it.
The record is 260 bytes, inside the 512-byte cap with room for both counters at
full width.
Files
Checklist
measurements/origin-ip.csvcommitted.measurements/stages.tsv.python3 scripts/gen-cost-table.py../run.shgreen (build + QEMU + baseline self-check) —run-report.mdcommitted.Context for review: 15 of 21 sequential single-commit PRs replaying the integration on top of the Baseline root. Each lands green and reviewed before the next is built on it, because a change to an early commit would force every commit above it to be re-run and re-measured.
Summary by CodeRabbit
New Features
Documentation