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