diff --git a/cpiface/zmq-cpiface.cc b/cpiface/zmq-cpiface.cc index 7b16b6489..3f5a6747e 100644 --- a/cpiface/zmq-cpiface.cc +++ b/cpiface/zmq-cpiface.cc @@ -251,12 +251,18 @@ int main(int argc, char **argv) { // Process messages from either socket while (true) { - static const zmq_pollitem_t items[] = { + zmq_pollitem_t items[] = { {receiver, 0, ZMQ_POLLIN, 0}, }; if (zmq_poll((zmq_pollitem_t *)items, 1, -1) < 0) { - std::cerr << "ZMQ poll failed!: " << strerror(errno) << std::endl; - return EXIT_FAILURE; + std::cerr << "ZMQ poll failed!: " << strerror(errno); + if (errno != EINTR) { + std::cerr << std::endl; + return EXIT_FAILURE; + } else { + std::cerr << "Retrying..." << std::endl; + continue; + } } if (items[0].revents & ZMQ_POLLIN) { struct msgbuf rbuf; @@ -342,7 +348,7 @@ int main(int argc, char **argv) { BessClient b(CreateChannel(std::string(args.bessd_ip) + ":" + std::to_string(args.bessd_port), InsecureChannelCredentials())); - b.runRemoveCommand(ntohl(rbuf.sess_entry.ue_addr.u.ipv4_addr), + b.runRemoveCommand((rbuf.sess_entry.ue_addr.u.ipv4_addr), args.encapmod); std::map::iterator it = zmq_sess_map.find( SESS_ID((rbuf.sess_entry.ue_addr.u.ipv4_addr), DEFAULT_BEARER));