aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-12-28 23:56:17 +0100
committerGitHub <[email protected]>2023-12-28 23:56:17 +0100
commita7eb6a44da09a48b3fd57f1bd4d4d095685a06b5 (patch)
tree31cdd16ce7ec75bf8811bf09c984a0ba0e884b1d
parent989901c09268cecc5aca558eaecd6ca3fc8bbb76 (diff)
parentd32fe0ccdcfe7507accf28caaf2ce03b4b5713f6 (diff)
Merge pull request #2371 from dzamlo/main
Add set_hop_limit to UDP sockets
-rw-r--r--embassy-net/src/udp.rs5
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
227impl Drop for UdpSocket<'_> { 232impl Drop for UdpSocket<'_> {