From 0cb7ad6d9cd2746845537594c6d5a173baaf3756 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 20 Jun 2008 17:38:51 +0000 Subject: [PATCH] Added check to make sure destination network address is zero, indicating a local destination (me) instead of a routed destination. --- bacnet-stack/src/npdu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/src/npdu.c b/bacnet-stack/src/npdu.c index 09e9dfe6..72e28b60 100644 --- a/bacnet-stack/src/npdu.c +++ b/bacnet-stack/src/npdu.c @@ -385,16 +385,19 @@ void npdu_handler( fprintf(stderr, "NPDU: Network Layer Message discarded!\n"); #endif } else if ((apdu_offset > 0) && (apdu_offset <= pdu_len)) { - /* only handle the version that we know how to handle */ - if (npdu_data.protocol_version == BACNET_PROTOCOL_VERSION) + if ((npdu_data.protocol_version == BACNET_PROTOCOL_VERSION) && + (dest.net == 0)) { + /* only handle the version that we know how to handle */ + /* and we are not a router, so ignore messages with + routing information cause they are not for us */ apdu_handler(src, &pdu[apdu_offset], (uint16_t) (pdu_len - apdu_offset)); + } } return; } - #ifdef TEST #include #include