Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SockProtocol::Raw = libc::IPPROTO_RAW for raw sockets #1848

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

StackOverflowExcept1on
Copy link
Contributor

@StackOverflowExcept1on StackOverflowExcept1on commented Oct 17, 2022

Hey, I wanna to make call like socket(af_type, SOCK_RAW, IPPROTO_RAW) but currently there is no way to do it with rust
https://github.com/rickettm/SendIP/blob/aad12a001157489ab9053c8665e09aec24a2ff6d/sendip.c#L143

Update: Feel free to add #[cfg] attribute if I made mistakes that might cause errors on some platforms

@StackOverflowExcept1on
Copy link
Contributor Author

@posborne @kamalmarhubi @asomers can anyone review this please? I think it's easy to merge

@asomers
Copy link
Member

asomers commented Oct 31, 2022

LGTM, but for a CHANGELOG entry. BTW, is SendIP something like Python's Scapy? I was using that this weekend.

@StackOverflowExcept1on
Copy link
Contributor Author

StackOverflowExcept1on commented Oct 31, 2022

@asomers added it to the changelog. I don't know what scapy is, but in rust we can get the fastest packet generation compared to the python library. BTW, how often do you have releases, if PR would be merged?

Update: Hmm, CI looks failed. Idk why but it isn't my problem

@StackOverflowExcept1on
Copy link
Contributor Author

@posborne @kamalmarhubi @asomers I'm sorry for the ping, but could you review this PR? Hope it's ready to be merged now

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rebase, that should fix the CI failures.

CHANGELOG.md Outdated
@@ -26,6 +26,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
([#1841](https://github.com/nix-rust/nix/pull/1841))
- Added `eaccess()` on FreeBSD, DragonFly and Linux (glibc and musl).
([#1842](https://github.com/nix-rust/nix/pull/1842))
- Added `SockProtocol::Raw = libc::IPPROTO_RAW` for raw sockets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Added `SockProtocol::Raw = libc::IPPROTO_RAW` for raw sockets
- Added `SockProtocol::Raw` for raw sockets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers I did some errors with rebase, but now looks likes CI is fine. Also merge conflict is now resolved

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors bors bot merged commit a75a349 into nix-rust:master Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants