Skip to content

Commit

Permalink
Corrected InitiatorAddress in ConnectionSetupResponse, which was inco…
Browse files Browse the repository at this point in the history
…rrectly assigned before
  • Loading branch information
Paolo Fittipaldi authored and Paolo Fittipaldi committed Oct 28, 2024
1 parent 4891199 commit 8ff611b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions quisp/messages/connection_setup_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ packet ConnectionSetupResponse extends Header
int application_id @getter(getApplicationId) @setter(setApplicationId);
int actual_srcAddr;
int actual_destAddr;
int initiator_addr @setter(setInitiatorAddr) @getter(getInitiatorAddr);
int responder_addr @setter(setResponderAddr) @getter(getResponderAddr);
unsigned long connection_setup_request_id @setter(setConnectionSetupRequestId) @getter(getConnectionSetupRequestId);
unsigned long RuleSet_id;
json ruleSet;
Expand Down
6 changes: 4 additions & 2 deletions quisp/modules/QRSA/ConnectionManager/ConnectionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ void ConnectionManager::handleMessage(cMessage *msg) {
if (auto *resp = dynamic_cast<ConnectionSetupResponse *>(msg)) {
reservation_register.updateReservationId(resp->getConnectionSetupRequestId(), resp->getRuleSet_id());

int initiator_addr = resp->getActual_destAddr();
int responder_addr = resp->getActual_srcAddr();
int initiator_addr = resp->getInitiatorAddr();
int responder_addr = resp->getResponderAddr();

if (initiator_addr == my_address || responder_addr == my_address) {
// this node is not a swapper
Expand Down Expand Up @@ -279,6 +279,8 @@ void ConnectionManager::respondToRequest(ConnectionSetupRequest *req) {
resp->setDestAddr(owner_address);
resp->setActual_srcAddr(my_address);
resp->setActual_destAddr(owner_address);
resp->setInitiatorAddr(req->getActual_srcAddr());
resp->setResponderAddr(my_address);
resp->setApplication_type(0);
resp->setKind(2);
send(resp, "RouterPort$o");
Expand Down

0 comments on commit 8ff611b

Please sign in to comment.