Skip to content

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Sep 12, 2023

Motivation

This patch adds support for custom protocol families to DatagramBootstrap. In most cases this isn't useful, and will fail, but in many OSes it's a recognised system for non-root processes to get a way to send ICMP echo requests. This is worth supporting.

Modifications

  • Expose the ProtocolSubtype type publicly.
  • Add a protocolSubtype setter on DatagramBootstrap
  • Write a test that actually does ICMP as non-root

Results

Users can send ICMP echo requests without root privileges.

Motivation

This patch adds support for custom protocol families to
DatagramBootstrap. In most cases this isn't useful, and will fail, but
in many OSes it's a recognised system for non-root processes to get a
way to send ICMP echo requests. This is worth supporting.

Modifications

- Expose the `ProtocolSubtype` type publicly.
- Add a `protocolSubtype` setter on `DatagramBootstrap`
- Write a test that actually does ICMP as non-root

Results

Users can send ICMP echo requests without root privileges.
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Sep 12, 2023
@Lukasa Lukasa linked an issue Sep 12, 2023 that may be closed by this pull request
@Lukasa Lukasa merged commit 3db5c4a into apple:main Sep 17, 2023
@Lukasa Lukasa deleted the cb-add-udp-protocol-family branch September 17, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending/Receiving IP Packets Without Root Privilege
3 participants