From 9f7bf5dc68788cbb3e0ee98a510d2bae9d4ca39d Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 14 Jun 2021 10:53:27 +0200 Subject: [PATCH] Adding support for retrieving socket handle from DHCP sockets --- src/socket/dhcpv4.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/socket/dhcpv4.rs b/src/socket/dhcpv4.rs index cc61373..c60f988 100644 --- a/src/socket/dhcpv4.rs +++ b/src/socket/dhcpv4.rs @@ -6,6 +6,7 @@ use crate::wire::{EthernetAddress, IpProtocol, IpAddress, use crate::wire::dhcpv4::{field as dhcpv4_field}; use crate::socket::SocketMeta; use crate::time::{Instant, Duration}; +use crate::socket::SocketHandle; use super::{PollAt, Socket}; @@ -420,6 +421,12 @@ impl Dhcpv4Socket { } } + /// Return the socket handle. + #[inline] + pub fn handle(&self) -> SocketHandle { + self.meta.handle + } + /// Reset state and restart discovery phase. /// /// Use this to speed up acquisition of an address in a new