Added check to keep us from getting BACnet/IP messages from ourselves
This commit is contained in:
@@ -268,6 +268,10 @@ uint16_t bip_receive(
|
|||||||
return 0;
|
return 0;
|
||||||
/* Original-Broadcast-NPDU or Original-Unicast-NPDU */
|
/* Original-Broadcast-NPDU or Original-Unicast-NPDU */
|
||||||
if ((buf[1] == 0x0B) || (buf[1] == 0x0A))
|
if ((buf[1] == 0x0B) || (buf[1] == 0x0A))
|
||||||
|
{
|
||||||
|
if (sin.sin_addr.s_addr == BIP_Address.s_addr)
|
||||||
|
pdu_len = 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// copy the source address
|
// copy the source address
|
||||||
src->mac_len = 6;
|
src->mac_len = 6;
|
||||||
@@ -288,6 +292,7 @@ uint16_t bip_receive(
|
|||||||
else
|
else
|
||||||
pdu_len = 0;
|
pdu_len = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pdu_len;
|
return pdu_len;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,6 +299,10 @@ uint16_t bip_receive(
|
|||||||
return 0;
|
return 0;
|
||||||
/* Original-Broadcast-NPDU or Original-Unicast-NPDU */
|
/* Original-Broadcast-NPDU or Original-Unicast-NPDU */
|
||||||
if ((buf[1] == 0x0B) || (buf[1] == 0x0A))
|
if ((buf[1] == 0x0B) || (buf[1] == 0x0A))
|
||||||
|
{
|
||||||
|
if (sin.sin_addr.s_addr == BIP_Address.s_addr)
|
||||||
|
pdu_len = 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// copy the source address
|
// copy the source address
|
||||||
src->mac_len = 6;
|
src->mac_len = 6;
|
||||||
@@ -319,6 +323,7 @@ uint16_t bip_receive(
|
|||||||
else
|
else
|
||||||
pdu_len = 0;
|
pdu_len = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pdu_len;
|
return pdu_len;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user