Skip to content

Incorrect CRC calculation in Riello driver. #2137

Closed

Description

@cool0nik

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)

Activity

  1. added
    RielloRiello UPS devices (serial, usb), usually with a variant of Qx protocol
    impacts-release-2.8.0Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks)
    on Oct 30, 2023
  2. added this to the 2.8.1 milestone on Oct 30, 2023
  3. jimklimov commented on Oct 30, 2023

    @jimklimov
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RielloRiello UPS devices (serial, usb), usually with a variant of Qx protocolbugimpacts-release-2.8.0Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks)

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions