File tree Expand file tree Collapse file tree 2 files changed +3
-19
lines changed
Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,6 @@ impl MmdsNetworkStack {
8181 mac_addr : MacAddr ,
8282 ipv4_addr : Ipv4Addr ,
8383 tcp_port : u16 ,
84- max_connections : NonZeroUsize ,
85- max_pending_resets : NonZeroUsize ,
8684 mmds : Arc < Mutex < Mmds > > ,
8785 ) -> Self {
8886 MmdsNetworkStack {
@@ -93,8 +91,8 @@ impl MmdsNetworkStack {
9391 tcp_handler : TcpIPv4Handler :: new (
9492 ipv4_addr,
9593 tcp_port,
96- max_connections ,
97- max_pending_resets ,
94+ NonZeroUsize :: new ( DEFAULT_MAX_CONNECTIONS ) . unwrap ( ) ,
95+ NonZeroUsize :: new ( DEFAULT_MAX_PENDING_RESETS ) . unwrap ( ) ,
9896 ) ,
9997 mmds,
10098 }
@@ -105,14 +103,7 @@ impl MmdsNetworkStack {
105103 let ipv4_addr = mmds_ipv4_addr. unwrap_or_else ( || Ipv4Addr :: from ( DEFAULT_IPV4_ADDR ) ) ;
106104
107105 // The unwrap()s are safe because the given literals are greater than 0.
108- Self :: new (
109- mac_addr,
110- ipv4_addr,
111- DEFAULT_TCP_PORT ,
112- NonZeroUsize :: new ( DEFAULT_MAX_CONNECTIONS ) . unwrap ( ) ,
113- NonZeroUsize :: new ( DEFAULT_MAX_PENDING_RESETS ) . unwrap ( ) ,
114- mmds,
115- )
106+ Self :: new ( mac_addr, ipv4_addr, DEFAULT_TCP_PORT , mmds)
116107 }
117108
118109 pub fn set_ipv4_addr ( & mut self , ipv4_addr : Ipv4Addr ) {
Original file line number Diff line number Diff line change 44//! Defines the structures needed for saving/restoring MmdsNetworkStack.
55
66use std:: net:: Ipv4Addr ;
7- use std:: num:: NonZeroUsize ;
87use std:: sync:: { Arc , Mutex } ;
98
109use serde:: { Deserialize , Serialize } ;
@@ -20,8 +19,6 @@ pub struct MmdsNetworkStackState {
2019 mac_addr : [ u8 ; MAC_ADDR_LEN as usize ] ,
2120 ipv4_addr : u32 ,
2221 tcp_port : u16 ,
23- max_connections : NonZeroUsize ,
24- max_pending_resets : NonZeroUsize ,
2522}
2623
2724impl Persist < ' _ > for MmdsNetworkStack {
@@ -37,8 +34,6 @@ impl Persist<'_> for MmdsNetworkStack {
3734 mac_addr,
3835 ipv4_addr : self . ipv4_addr . into ( ) ,
3936 tcp_port : self . tcp_handler . local_port ( ) ,
40- max_connections : self . tcp_handler . max_connections ( ) ,
41- max_pending_resets : self . tcp_handler . max_pending_resets ( ) ,
4237 }
4338 }
4439
@@ -50,8 +45,6 @@ impl Persist<'_> for MmdsNetworkStack {
5045 MacAddr :: from_bytes_unchecked ( & state. mac_addr ) ,
5146 Ipv4Addr :: from ( state. ipv4_addr ) ,
5247 state. tcp_port ,
53- state. max_connections ,
54- state. max_pending_resets ,
5548 mmds,
5649 ) )
5750 }
You can’t perform that action at this time.
0 commit comments