Skip to content

Split send-bsd.h into send-mac.h and send-bsd.h and add GitHub action for compiling on FreeBSD/MacOS#771

Merged
phillip-stephens merged 34 commits intomainfrom
phillip/769
Feb 5, 2024
Merged

Split send-bsd.h into send-mac.h and send-bsd.h and add GitHub action for compiling on FreeBSD/MacOS#771
phillip-stephens merged 34 commits intomainfrom
phillip/769

Conversation

@phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Feb 2, 2024

  • Split up send-mac.h from send-bsh.h so that each can take advantage of the sys calls available on that OS
  • Added GitHub Actions for MacOS and FreeBSD
  • Corrected comment that erroneously claimed BSD didn't have sendmmsg

@phillip-stephens phillip-stephens self-assigned this Feb 2, 2024
@phillip-stephens phillip-stephens linked an issue Feb 2, 2024 that may be closed by this pull request
2 tasks
@phillip-stephens phillip-stephens marked this pull request as ready for review February 2, 2024 23:32
@zakird
Copy link
Member

zakird commented Feb 3, 2024

Code looks good, though there's been a bunch of commits post you asking for review, so I'm not 100% sure if it's ready to merge. Can you merge when ready?

@phillip-stephens
Copy link
Contributor Author

Yeahhh. Wanted to test my new Github Action to test compiling on FreeBSD on every PR, but the only way to test was to commit and push and run here. Sooooo, hence the 10k commits lol. I did add the #do-not-review label to try to prevent this 😄

@phillip-stephens
Copy link
Contributor Author

I still have a few things left to do (test using sendmmsg on FreeBSD in a VM), then I'll request a re-review and we can merge.
cc: @zakird

@zakird
Copy link
Member

zakird commented Feb 4, 2024

Sounds good. I missed label 🤦🏽 Usually just look at "Draft" status, but will keep my eye out!!

@phillip-stephens phillip-stephens changed the title Let BSD variants use sendmmsg and add GitHub action for compiling on FreeBSD Split send-bsd.h into send-mac.h and send-bsd.h and add GitHub action for compiling on FreeBSD/MacOS Feb 5, 2024
@phillip-stephens
Copy link
Contributor Author

I've realized that BSD handles sockets differently than linux. After taking a stab at figuring out how to port the linux sendmmsg into BSD, it's not as trivial as I imagined. If I had more experience with BSD, I'm sure it'd be a breeze, but c'est la vie. I'm going to re-define this issue as just splitting up the send-bsd.h and send-mac.h, update the comments explaining why each doesn't have the sendmmsg code (non-trivial to port and doesn't exist, respectively) so they're accurate, and add a MacOS compile GitHub Action.

If porting sendmmsg to BSD is a priority, I'll come back to it as a second PR.

@zakird
Copy link
Member

zakird commented Feb 5, 2024

If porting sendmmsg to BSD is a priority, I'll come back to it as a second PR.

I don't think it is for the core team. If someone else wants to take a look, always happy to accept a PR, but I think that we have a number of more pressing issues.

@phillip-stephens phillip-stephens added this to the ZMap 4.1 milestone Feb 5, 2024
@phillip-stephens phillip-stephens merged commit a9b310e into main Feb 5, 2024
@phillip-stephens phillip-stephens deleted the phillip/769 branch February 5, 2024 22:29
droe added a commit to droe/zmap that referenced this pull request Feb 7, 2024
This leftover bit was the result of a collision of two in-flight PRs.
The last use of _SYSTYPE_BSD was removed along with libdnet in zmap#772,
while zmap#771 concurrently added the -D_SYSTYPE_BSD to CMakeLists.txt.

_SYSTYPE_BSD is a rather archaic define.  libdnet might have used it for
compat with now historical systems/compilers, but I do not think it
served any purpose beyond that.  Certainly, modern FreeBSD, NetBSD and
macOS do not reference it.  It seems safe to remove.
zakird pushed a commit that referenced this pull request Feb 7, 2024
This leftover bit was the result of a collision of two in-flight PRs.
The last use of _SYSTYPE_BSD was removed along with libdnet in #772,
while #771 concurrently added the -D_SYSTYPE_BSD to CMakeLists.txt.

_SYSTYPE_BSD is a rather archaic define.  libdnet might have used it for
compat with now historical systems/compilers, but I do not think it
served any purpose beyond that.  Certainly, modern FreeBSD, NetBSD and
macOS do not reference it.  It seems safe to remove.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split send-bsd.h into send-mac.h and send-bad.h

2 participants