summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2025-07-01 12:19:43 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2025-07-01 12:19:43 +0530
commitec1ed6738bbfb670fcb409b08ed53c509a7b957d (patch)
tree79abdd2142d4d4caa4f86d3342fa1283f07170d5 /src
parent97b4d5e66561724756527973e3675fd76ea6b5a6 (diff)
Rename here as well.
Diffstat (limited to 'src')
-rw-r--r--src/vrrpv2.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs
index 3613d9b..14c4146 100644
--- a/src/vrrpv2.rs
+++ b/src/vrrpv2.rs
@@ -196,15 +196,15 @@ pub fn from_bytes(bytes: &[u8]) -> Result<VRRPv2, VRRPv2Error> {
fn checksum(bytes: &[u8]) -> u16 {
let (chunks, remainder) = bytes.as_chunks::<2>();
- let mut sum = chunks
+ let mut cksum = chunks
.iter()
.fold(0, |acc, x| acc + u32::from(u16::from_be_bytes(*x)));
if !remainder.is_empty() {
- sum += u32::from(remainder[0]);
+ cksum += u32::from(remainder[0]);
}
- sum = (sum >> 16) + (sum & 0xffff);
- sum += sum >> 16;
- !(sum as u16)
+ cksum = (cksum >> 16) + (cksum & 0xffff);
+ cksum += cksum >> 16;
+ !(cksum as u16)
}
#[test]