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

Fix incorrect device_id initialization #1184

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

lars18th
Copy link
Contributor

@lars18th lars18th commented Sep 9, 2024

This fix solves the problem of messages Device ID conflict, changing our device id to... at the start caused by an incorrect initialization. Without this fix the values from -D --device-id parameters and bootid file are not used.

@lars18th
Copy link
Contributor Author

lars18th commented Sep 9, 2024

Hi @Jalle19 ,

Please merge it. When running with multiple SAT>IP servers in the same network you will see the trouble.

@Jalle19
Copy link
Collaborator

Jalle19 commented Sep 9, 2024

I'm not entirely sure what the problem is here? Device ID initialization from bootid file seems to work fine at least?

@lars18th
Copy link
Contributor Author

lars18th commented Sep 9, 2024

I'm not entirely sure what the problem is here? Device ID initialization from bootid file seems to work fine at least?

NO. With the last changes of the initialization a BIG BUG is present: The code allways starts to count from 1. Therefore the stored value and the enforced value of the parameter is never used.

This patch is necessary. Please, merge it.
Thank you.

@Jalle19
Copy link
Collaborator

Jalle19 commented Sep 9, 2024

Okay, I think I get it now. This is mainly about fixing the scenario where a conflict is detected, opts.device_id is incremented and readBootID() is called again?

@Jalle19 Jalle19 merged commit 209f02c into catalinii:master Sep 9, 2024
9 checks passed
@lars18th
Copy link
Contributor Author

lars18th commented Sep 9, 2024

Okay, I think I get it now. This is mainly about fixing the scenario where a conflict is detected, opts.device_id is incremented and readBootID() is called again?

Not really. With the "previous" code the "initial" value is allways 1, and the paramters and bootid data is overwrited.

And thank you for merging it! 😉

Note: One edge case not considered. Fixed too in #1186.

@lars18th lars18th deleted the fix-deviceid branch September 9, 2024 20:32
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

Successfully merging this pull request may close these issues.

2 participants