Removed fix for Revision 2094, as this broke the ability to bind to MAC addresses, and the NPDU is the source for the SNET in the address.
This commit is contained in:
+4
-14
@@ -295,20 +295,10 @@ uint16_t bip_receive(
|
|||||||
fprintf(stderr, "BIP: src is me. Discarded!\n");
|
fprintf(stderr, "BIP: src is me. Discarded!\n");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
/* If this was an Original_Broadcast, ensure that
|
/* data in src->mac[] is in network format */
|
||||||
* the response gets bcast back by this:
|
src->mac_len = 6;
|
||||||
*/
|
memcpy(&src->mac[0], &sin.sin_addr.s_addr, 4);
|
||||||
if (pdu[1] == BVLC_ORIGINAL_BROADCAST_NPDU) {
|
memcpy(&src->mac[4], &sin.sin_port, 2);
|
||||||
src->net = BACNET_BROADCAST_NETWORK;
|
|
||||||
src->mac_len = 0;
|
|
||||||
} else {
|
|
||||||
src->net = 0;
|
|
||||||
/* data in src->mac[] is in network format */
|
|
||||||
src->mac_len = 6;
|
|
||||||
memcpy(&src->mac[0], &sin.sin_addr.s_addr, 4);
|
|
||||||
memcpy(&src->mac[4], &sin.sin_port, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FIXME: check destination address */
|
/* FIXME: check destination address */
|
||||||
/* see if it is broadcast or for us */
|
/* see if it is broadcast or for us */
|
||||||
/* decode the length of the PDU - length is inclusive of BVLC */
|
/* decode the length of the PDU - length is inclusive of BVLC */
|
||||||
|
|||||||
Reference in New Issue
Block a user