We hit this same issue and believe it occurs if a ZED or ZR asks the ZC to leave the network. The ZC goes on to delete it's network security keys (0's them - which in itself is probably a bug), panid and other network information and then do a soft reset. I our case we believe a COTS sensor we recently started experimenting with sends the erroneous packets.
Proposed fix in ZDApp.c:
@ -3127,6 +3127,13 @@ void ZDO_LeaveCnf( NLME_LeaveCnf_t* cnf ) if ( osal_ExtAddrEqual( cnf->extAddr, NLME_GetExtAddr() ) == TRUE ) { // MH: Prevent other routers and EDs from destroying the network // by asking the ZC to leave. // Without this check the ZC will clear network keys, panid etc if(ZG_DEVICE_COORDINATOR_TYPE){ return; } // Pass the leave confirm to higher layer if callback registered if ( ( zdoCBFunc[ZDO_LEAVE_CNF_CBID] == NULL ) || ( (*zdoCBFunc[ZDO_LEAVE_CNF_CBID])( cnf ) == NULL ) )
We still need to confirm this fix fully.