Skip to content

Commit de8fba6

Browse files
committed
Add intermediate RENEWINGSENT DHCP state
1 parent 6bc7dc4 commit de8fba6

File tree

1 file changed

+17
-0
lines changed
  • crates/lib-dhcp/src/client/state

1 file changed

+17
-0
lines changed

crates/lib-dhcp/src/client/state/dhcp.rs

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub enum DhcpState {
1212
Rebinding,
1313
Bound,
1414
Renewing,
15+
RenewingSent,
1516
}
1617

1718
impl Default for DhcpState {
@@ -31,6 +32,7 @@ impl Display for DhcpState {
3132
DhcpState::Rebinding => write!(f, "REBINDING"),
3233
DhcpState::Bound => write!(f, "BOUND"),
3334
DhcpState::Renewing => write!(f, "RENEWING"),
35+
DhcpState::RenewingSent => write!(f, "RENEWINGSENT"),
3436
}
3537
}
3638
}
@@ -152,6 +154,21 @@ impl DhcpStateMachine for Client {
152154
}
153155
_ => Err(DhcpStateError::new(self.dhcp_state.clone(), state)),
154156
},
157+
DhcpState::RenewingSent => match state {
158+
next @ DhcpState::Renewing => {
159+
self.dhcp_state = next;
160+
Ok(())
161+
}
162+
next @ DhcpState::Rebinding => {
163+
self.dhcp_state = next;
164+
Ok(())
165+
}
166+
next @ DhcpState::Bound => {
167+
self.dhcp_state = next;
168+
Ok(())
169+
}
170+
_ => Err(DhcpStateError::new(self.dhcp_state.clone(), state)),
171+
},
155172
}
156173
}
157174
}

0 commit comments

Comments
 (0)