Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating session deletion logic that makes endian order uniform. #86

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cpiface/zmq-cpiface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ int main(int argc, char **argv) {
resp.sess_id = rbuf.sess_entry.sess_id;
/* why is the ue ip address stored in reverse endian order just in
* delete message? */
if (zmq_sess_map.find(
SESS_ID(ntohl(rbuf.sess_entry.ue_addr.u.ipv4_addr),
DEFAULT_BEARER)) == zmq_sess_map.end()) {
if (zmq_sess_map.find(SESS_ID((rbuf.sess_entry.ue_addr.u.ipv4_addr),
DEFAULT_BEARER)) ==
zmq_sess_map.end()) {
std::cerr << "No record found!" << std::endl;
break;
}
Expand All @@ -345,8 +345,7 @@ int main(int argc, char **argv) {
b.runRemoveCommand(ntohl(rbuf.sess_entry.ue_addr.u.ipv4_addr),
args.encapmod);
std::map<std::uint64_t, bool>::iterator it = zmq_sess_map.find(
SESS_ID(ntohl(rbuf.sess_entry.ue_addr.u.ipv4_addr),
DEFAULT_BEARER));
SESS_ID((rbuf.sess_entry.ue_addr.u.ipv4_addr), DEFAULT_BEARER));
zmq_sess_map.erase(it);
}
break;
Expand Down