Skip to content

fix: use configured BIP port for gateway client transport#8

Merged
jscott3201 merged 1 commit intojscott3201:devfrom
chappo:fix/gateway-client-port
Mar 24, 2026
Merged

fix: use configured BIP port for gateway client transport#8
jscott3201 merged 1 commit intojscott3201:devfrom
chappo:fix/gateway-client-port

Conversation

@chappo
Copy link
Contributor

@chappo chappo commented Mar 24, 2026

Summary

  • Gateway client transport was hardcoded to port 0 in builder.rs:134, causing the OS to assign a random ephemeral port for outgoing BACnet/IP requests
  • The server transport on line 93 correctly used bip.port from the gateway config
  • This one-line fix passes bip.port to the client transport as well

The bug

// Before — binds to random ephemeral port
let mut client_transport = BipTransport::new(interface, 0, broadcast);

// After — uses configured port (default 47808)
let mut client_transport = BipTransport::new(interface, bip.port, broadcast);

Impact

Outgoing BACnet requests originated from a random port instead of the configured BACnet/IP port (typically 47808). Devices responding to the standard port would not reach the client, breaking request/response communication.

🤖 Generated with Claude Code

The client transport was hardcoded to port 0, causing the OS to assign
a random ephemeral port for outgoing BACnet requests. This breaks
device communication when devices respond to the standard BACnet port
(47808) and the client is listening on a different random port.

Use `bip.port` from the gateway config, matching the server transport
which already used the configured port correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jscott3201 jscott3201 self-assigned this Mar 24, 2026
@jscott3201
Copy link
Owner

Nice catch! I'll let this run on checks and get that fixed.

@jscott3201 jscott3201 changed the base branch from main to dev March 24, 2026 05:16
@jscott3201 jscott3201 merged commit fd3217d into jscott3201:dev Mar 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants