khemraj / sanlock

Forked from sanlock 2 years ago
Clone

7212272 sanlock: fix checksum endian handling

Authored and Committed by teigland 9 years ago
    sanlock: fix checksum endian handling
    
    checksums must be computed while the data is in the
    ondisk format (little endian).
    
    When writing a structure:
    - byte swap the structure data from host format to ondisk format
    - compute the host format checksum value from the ondisk data
    - byte swap the checksum value from host format to ondisk format
    - write the ondisk format checksum into the structure
    
    When reading a structure:
    - compute the host format checksum from the ondisk data
    - byte swap the structure data from ondisk format to host format
    - verify the computed host format checksum matches the
      checksum in the host format structure
    
    Signed-off-by: David Teigland <teigland@redhat.com>
    
        
file modified
+64 -12
file modified
+17 -0
file modified
+4 -24
file modified
+25 -0
file modified
+95 -40
file modified
+1 -0
file modified
+4 -1