DADR is only valid when DNET is specified (i.e. net is non-zero).

This commit is contained in:
skarg
2012-09-19 21:27:00 +00:00
parent f5c9073853
commit 6a2d467fc2
3 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -166,8 +166,8 @@ int bip_send_pdu(
mtu[0] = BVLL_TYPE_BACNET_IP;
bip_dest.sin_family = AF_INET;
if (dest->net == BACNET_BROADCAST_NETWORK
|| dest->len == 0
if (dest->net == BACNET_BROADCAST_NETWORK
|| ((dest->net > 0) && (dest->len == 0))
|| dest->mac_len == 0) {
/* broadcast */
address.s_addr = BIP_Broadcast_Address.s_addr;
+6 -2
View File
@@ -1140,8 +1140,12 @@ 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
|| dest->len == 0
/* handle various broadcasts: */
/* mac_len = 0 is a broadcast address */
/* net = 0 indicates local, net = 65535 indicates global */
/* net > 0 and net < 65535 are network specific broadcast if len = 0 */
if ( dest->net == BACNET_BROADCAST_NETWORK
|| ((dest->net > 0) && (dest->len == 0))
|| dest->mac_len == 0) {
/* if we are a foreign device */
if (Remote_BBMD.sin_port) {