fix: using incomplete struct sockaddr_in#130
Conversation
Some platform SDKs don't `#include <netinet/in.h>` in `sys/socket.h`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes add support for conditionally including the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 58.57% 63.77% +5.19%
==========================================
Files 32 34 +2
Lines 2607 2912 +305
Branches 526 546 +20
==========================================
+ Hits 1527 1857 +330
+ Misses 745 709 -36
- Partials 335 346 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves POSIX networking portability by explicitly including <netinet/in.h> (when available) to ensure struct sockaddr_in and related IPv4 definitions are complete on platforms where <sys/socket.h> doesn’t include it.
Changes:
- Add CMake detection for the presence of
<netinet/in.h>. - Plumb the detection result into
proxyres_config.h. - Conditionally include
<netinet/in.h>in POSIX networking source files.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
CMakeLists.txt |
Adds check_include_file("netinet/in.h" ...) so builds can detect header availability. |
proxyres_config.h.in |
Introduces HAVE_NETINET_IN_H config macro for conditional compilation. |
wpad_dhcp_posix.c |
Conditionally includes <netinet/in.h> to avoid incomplete sockaddr_in on some SDKs. |
net_util.c |
Conditionally includes <netinet/in.h> for consistent IPv4 type/constant availability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Some platform SDKs don't
#include <netinet/in.h>insys/socket.h.Summary by CodeRabbit