From d32fe0ccdcfe7507accf28caaf2ce03b4b5713f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Damien?= Date: Thu, 28 Dec 2023 22:15:16 +0100 Subject: [PATCH] Add set_hop_limit to UDP sockets --- embassy-net/src/udp.rs | 5 +++++ 1 file changed, 5 insertions(+) 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> { pub fn payload_send_capacity(&self) -> usize { self.with(|s, _| s.payload_send_capacity()) } + + /// Set the hop limit field in the IP header of sent packets. + pub fn set_hop_limit(&mut self, hop_limit: Option) { + self.with_mut(|s, _| s.set_hop_limit(hop_limit)) + } } impl Drop for UdpSocket<'_> {