Hi, I am trying to access a function of the Queue from the self-implemented MAC protocol, but I keep getting segmentation fault errors. The important parts of code are: As part of MAC protocol: PriQueue* myQueue = dynamic_cast <PriQueue*> (callback_); return myQueue->getPacketByDst(address); As part of the Queue: Packet* PriQueue::getPacketByDst(int dst) { printf("Searching the Queue \n"); if (pq_->head()) { printf("something\n"); } } Any ideas why I get a segmentation error? How should I go about if I want to search all packets from the Queue for a specific packet (from the MAC protocol layer)? Any help appreciated. Aurel