diff options
| author | Loïc Damien <[email protected]> | 2023-12-28 22:15:16 +0100 |
|---|---|---|
| committer | Loïc Damien <[email protected]> | 2023-12-28 22:15:16 +0100 |
| commit | d32fe0ccdcfe7507accf28caaf2ce03b4b5713f6 (patch) | |
| tree | dd2fbff9ba16ec653ddc561d7026742e6ba86c94 /embassy-net/src | |
| parent | 47a94f22aa040f195a6265ff6950187647e1fe48 (diff) | |
Add set_hop_limit to UDP sockets
Diffstat (limited to 'embassy-net/src')
| -rw-r--r-- | embassy-net/src/udp.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index d9df5b29d..a22cd8827 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs | |||
| @@ -222,6 +222,11 @@ impl<'a> UdpSocket<'a> { | |||
| 222 | pub fn payload_send_capacity(&self) -> usize { | 222 | pub fn payload_send_capacity(&self) -> usize { |
| 223 | self.with(|s, _| s.payload_send_capacity()) | 223 | self.with(|s, _| s.payload_send_capacity()) |
| 224 | } | 224 | } |
| 225 | |||
| 226 | /// Set the hop limit field in the IP header of sent packets. | ||
| 227 | pub fn set_hop_limit(&mut self, hop_limit: Option<u8>) { | ||
| 228 | self.with_mut(|s, _| s.set_hop_limit(hop_limit)) | ||
| 229 | } | ||
| 225 | } | 230 | } |
| 226 | 231 | ||
| 227 | impl Drop for UdpSocket<'_> { | 232 | impl Drop for UdpSocket<'_> { |
