fix: Destination ports used in network traffic

This commit is contained in:
Andrew Rioux
2024-02-08 19:03:28 -05:00
parent 607fb72e65
commit 93754e2cba
4 changed files with 7 additions and 4 deletions

View File

@@ -110,8 +110,8 @@ pub async fn connect(config: PathBuf, ip: SocketAddr) -> anyhow::Result<()> {
Ok(packet) => {
let (count, addr) = packet?;
if addr != ip {
bail!("received response from wrong source");
if addr.ip() != ip.ip() {
bail!("received response from wrong source (expected {ip:?}; got {addr:?})");
}
let data = &buf[..count];