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

[Unexpected issue]: TCP handler mixed up the TA and SA when sending the diag request #46

Open
ZelongXie opened this issue Jul 22, 2024 · 2 comments

Comments

@ZelongXie
Copy link

The issue occurred in lines 523 to 528 of the file doip_diagnostic_message_handler.cpp

// Add source address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));
// Add target address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));

This code should be modified to the following content:

// Add source address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));
// Add target address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetTa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetTa() & 0x00FF));

@Iandiehard

@ZelongXie ZelongXie changed the title TCP handler mixed up the TA and SA when sending the diag request. [Unexpected issue]: TCP handler mixed up the TA and SA when sending the diag request Jul 22, 2024
@Iandiehard
Copy link
Owner

Thank you. I have fixed it already here #39

@Iandiehard
Copy link
Owner

@ZelongXie : #39 is merged to main. Please verify and close the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants