Added check to keep us from getting BACnet/IP messages from ourselves

This commit is contained in:
skarg
2005-07-03 11:17:36 +00:00
parent 0bf6b5885e
commit 81ce0fef85
2 changed files with 44 additions and 34 deletions
+5
View File
@@ -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;
} }
+5
View File
@@ -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;
} }