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

Incorrect CRC calculation in Riello driver. #2137

Closed
cool0nik opened this issue Oct 29, 2023 · 1 comment · Fixed by #2138
Closed

Incorrect CRC calculation in Riello driver. #2137

cool0nik opened this issue Oct 29, 2023 · 1 comment · Fixed by #2138
Labels
bug impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) Riello Riello UPS devices (serial, usb), usually with a variant of Qx protocol
Milestone

Comments

@cool0nik
Copy link

In file nut/drivers/riello.c

This line:
pom = (pom << 8) ^ (pom << 3) ^ (pom >> 4);
was replaced by:
pom = (uint16_t)(pom << 8);
pom ^= (pom << 3);
pom ^= (pom >> 4);

This is wrong changes.
The result of CRC calculation was changed.
UPS does not working with this change and change should be reverted.

This "optimization" was introduced here:
6a2e042

Issue was found during upgrade Debein 11 -> 12.
from
Network UPS Tools - Riello serial driver 0.03 (2.7.4)
to
Network UPS Tools - Riello serial driver 0.07 (2.8.0)

@jimklimov jimklimov added bug Riello Riello UPS devices (serial, usb), usually with a variant of Qx protocol impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) labels Oct 30, 2023
@jimklimov jimklimov added this to the 2.8.1 milestone Oct 30, 2023
@jimklimov
Copy link
Member

jimklimov commented Oct 30, 2023

Thanks for the report. I also see now what went wrong with that change, sorry about that.

Would you be able to check the PR above, with e.g. https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) Riello Riello UPS devices (serial, usb), usually with a variant of Qx protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants