Fixed BACnet/IP to handler remote network broadcast that is unicast to the router.

This commit is contained in:
skarg
2014-08-02 00:05:00 +00:00
parent 862d6622d7
commit 0be5ddce65
2 changed files with 22 additions and 5 deletions
+10 -2
View File
@@ -166,12 +166,20 @@ int bip_send_pdu(
mtu[0] = BVLL_TYPE_BACNET_IP;
bip_dest.sin_family = AF_INET;
if ((dest->net == BACNET_BROADCAST_NETWORK) || ((dest->net > 0) &&
(dest->len == 0)) || (dest->mac_len == 0)) {
if ((dest->net == BACNET_BROADCAST_NETWORK) || (dest->mac_len == 0)) {
/* broadcast */
address.s_addr = BIP_Broadcast_Address.s_addr;
port = BIP_Port;
mtu[1] = BVLC_ORIGINAL_BROADCAST_NPDU;
} else if ((dest->net > 0) && (dest->len == 0)) {
/* network specific broadcast */
if (dest->mac_len == 6) {
bip_decode_bip_address(dest, &address, &port);
} else {
address.s_addr = BIP_Broadcast_Address.s_addr;
port = BIP_Port;
}
mtu[1] = BVLC_ORIGINAL_BROADCAST_NPDU;
} else if (dest->mac_len == 6) {
bip_decode_bip_address(dest, &address, &port);
mtu[1] = BVLC_ORIGINAL_UNICAST_NPDU;