mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00
fix: inject socket local address for the client addr (#759)
We used to inject the resolved target server address, but that is not what is expected. Server typically ignores this field so this was not a problem up until now.
This commit is contained in:
parent
ec1832bba0
commit
712da42ded
14 changed files with 125 additions and 112 deletions
|
@ -123,32 +123,21 @@ impl State for ClientConnectorState {
|
|||
pub struct ClientConnector {
|
||||
pub config: Config,
|
||||
pub state: ClientConnectorState,
|
||||
pub client_addr: Option<SocketAddr>,
|
||||
/// The client address to be used in the Client Info PDU.
|
||||
pub client_addr: SocketAddr,
|
||||
pub static_channels: StaticChannelSet,
|
||||
}
|
||||
|
||||
impl ClientConnector {
|
||||
pub fn new(config: Config) -> Self {
|
||||
pub fn new(config: Config, client_addr: SocketAddr) -> Self {
|
||||
Self {
|
||||
config,
|
||||
state: ClientConnectorState::ConnectionInitiationSendRequest,
|
||||
client_addr: None,
|
||||
client_addr,
|
||||
static_channels: StaticChannelSet::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets the client address to be used in the Client Info PDU.
|
||||
#[must_use]
|
||||
pub fn with_client_addr(mut self, addr: SocketAddr) -> Self {
|
||||
self.client_addr = Some(addr);
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the client address to be used in the Client Info PDU.
|
||||
pub fn attach_client_addr(&mut self, addr: SocketAddr) {
|
||||
self.client_addr = Some(addr);
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_static_channel<T>(mut self, channel: T) -> Self
|
||||
where
|
||||
|
@ -448,12 +437,7 @@ impl Sequence for ClientConnector {
|
|||
} => {
|
||||
debug!("Secure Settings Exchange");
|
||||
|
||||
let client_addr = self
|
||||
.client_addr
|
||||
.as_ref()
|
||||
.ok_or_else(|| general_err!("client address is missing"))?;
|
||||
|
||||
let client_info = create_client_info_pdu(&self.config, client_addr);
|
||||
let client_info = create_client_info_pdu(&self.config, &self.client_addr);
|
||||
|
||||
debug!(message = ?client_info, "Send");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue