fix BACnet/IP on OS to bind broadcast to specific port (#489)

* Fixes #346 by binding the broadcast socket to the port specific broadcast address rather than INADDR_ANY or INADDR_BROADCAST. Added additional compile and environment options for those who might need them. 

* Changed the define USE_CLASSADDR to BACNET_IP_BROADCAST_USE_CLASSADDR to help manage namespaces.

* Added BACNET_IP_BROADCAST_BIND_ADDR environment variable to override the default broadcast binding address.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2023-09-10 10:24:18 -05:00
committed by GitHub
parent 0001f85f29
commit 55b8b3d93c
18 changed files with 231 additions and 58 deletions
+7
View File
@@ -73,6 +73,12 @@ ifeq (${BACNET_PORT},)
ifeq ($(UNAME_S),Darwin)
BACNET_PORT = bsd
endif
ifeq ($(UNAME_S),FreeBSD)
BACNET_PORT = bsd
endif
ifeq ($(UNAME_S),OpenBSD)
BACNET_PORT = bsd
endif
endif
endif
@@ -95,6 +101,7 @@ ifeq (${BACNET_PORT},bsd)
PFLAGS = -pthread
TARGET_EXT =
SYSTEM_LIB=-lc,-lm
CSTANDARD = -std=c99
endif
ifeq (${BACNET_PORT},win32)
# winget install --id=MSYS2.MSYS2 -e