Added BACNET_IP_BROADCAST_USE_INADDR_ANY ifdef option for router port binding. (#953)

This commit is contained in:
Steve Karg
2025-03-31 08:05:30 -05:00
committed by GitHub
parent 6f7f3649a5
commit 866de072ac
+4 -2
View File
@@ -176,9 +176,11 @@ bool dl_ip_init(ROUTER_PORT *port, IP_DATA *ip_data)
/* bind the socket to the local port number */
sin.sin_family = AF_INET;
/* sin.sin_addr.s_addr, ip_data->local_addr.s_addr;// =
* htonl(INADDR_ANY); */
#if defined(BACNET_IP_BROADCAST_USE_INADDR_ANY)
sin.sin_addr.s_addr = htonl(INADDR_ANY);
#else
sin.sin_addr.s_addr = ip_data->local_addr.s_addr;
#endif
sin.sin_port = ip_data->port;
status = bind(