Closed Tachi107 closed 1 year ago
Patch coverage: 75.80
% and project coverage change: -0.39
:warning:
Comparison is base (
91952a8
) 78.60% compared to head (090e6a9
) 78.22%.:exclamation: Current head 090e6a9 differs from pull request most recent head 0eb0cda. Consider uploading reports for the commit 0eb0cda to get more accurate results
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Yeah there are a lot of sizeof
s without parentheses, I'll change them later
@kiplingw please keep this PR in draft status until I'm confident to let you merge it. I'm not done yet :)
Hey @dennisjenkins75 and @kiplingw, could you please have a look at at the changes? You can find all the relevant descriptions in the various commits.
I'm not completely done yet, I'd like to reorder the commit history, for instance.
Sure @Tachi107. Will review when back at my desk.
:( I have only ever written unix sockets code the old way. I was unaware of the newer APIs. I have no problems with the code cleanup so long as it passes all unit tests.
From what I understood of it, it looks fine to me. Good work @Tachi107. Let us know when you are ready and I will re-review before merging. Main thing is, as @dennisjenkins75 said, don't break CI.
The commit history is now neatly separated in three independent commits with a somewhat exhaustive explanation about the relevant changes, and I've also added a couple more small tests. Lastly, I bumped the version to 0.2.0, since this patch introduces new features.
The commitlint and abidiff failures are expected.
@kiplingw I'll patiently wait for your re-review and merge :)
@Tachi107, BSD sockets aren't my strong point because it's been years since I had to directly use them. But from what I can understand it looks fine to me. One question I have for you though is did you try running through valgrind to see if there's any buffer overflows or other memory corruption issues before and after the changes?
Yes, I've run both under valgrind and no memory errors were raised. Note however that CI runs all tests under the memory sanitizer, which similar to valgrind in many ways.
Il 3 luglio 2023 19:46:27 CEST, Kip @.***> ha scritto:
@Tachi107, BSD sockets aren't my strong point because it's been years since I had to directly use them. But from what I can understand it looks fine to me. One question I have for you though is did you try running through valgrind to see if there's any buffer overflows or other memory corruption issues before and after the changes?
On Mon, 2023-07-03 at 13:30 -0700, Andrea Pappacoda wrote:
Yes, I've run both under valgrind and no memory errors were raised. Note however that CI runs all tests under the memory sanitizer, which similar to valgrind in many ways.
Perfect. Don't forget to bump d/changelog too.
-- Kip Warner OpenPGP signed/encrypted mail preferred https://www.thevertigo.com
Using a
struct sockaddr_storage
allows us to get rid of the spooky union ofsockaddr_in
andsockaddr_in6
, and to do IPv4 and IPv6 as recommended by RFC 3493.The code is not that cleaner, but it should be more robust and less "dangerous". As discussed recently on IRC, Kip and I were quite puzzled by the various constructors of class IP, as it wasn't immediatly clear why they were
memcpy
ingINET_ADDRSTRLEN
bytes into a smallers_addr
array.Needless to say, this is a breaking change. I also removed a few now useless functions, but they could be kept if desired.
Note: this is still experimental and incomplete.