added checks to allow broadcast to network or if mac address is not specified

This commit is contained in:
netp
2012-08-07 03:43:19 +00:00
parent 6bac1f18bc
commit 6a8fdcca74
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -166,7 +166,9 @@ int bip_send_pdu(
mtu[0] = BVLL_TYPE_BACNET_IP;
bip_dest.sin_family = AF_INET;
if (dest->net == BACNET_BROADCAST_NETWORK) {
if (dest->net == BACNET_BROADCAST_NETWORK
|| dest->len == 0
|| dest->mac_len == 0) {
/* broadcast */
address.s_addr = BIP_Broadcast_Address.s_addr;
port = BIP_Port;
+3 -1
View File
@@ -1140,7 +1140,9 @@ int bvlc_send_pdu(
/* bip datalink doesn't need to know the npdu data */
(void) npdu_data;
mtu[0] = BVLL_TYPE_BACNET_IP;
if (dest->net == BACNET_BROADCAST_NETWORK) {
if ( dest->net == BACNET_BROADCAST_NETWORK
|| dest->len == 0
|| dest->mac_len == 0) {
/* if we are a foreign device */
if (Remote_BBMD.sin_port) {
mtu[1] = BVLC_DISTRIBUTE_BROADCAST_TO_NETWORK;