From 89c0f1cdfe4e5e3742623d8e119aaadda21cb12f Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Thu, 11 Sep 2025 09:47:46 +0530 Subject: Remove obvious comments. --- src/vrrpv2.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs index 7e4a6cd..18011f1 100644 --- a/src/vrrpv2.rs +++ b/src/vrrpv2.rs @@ -86,8 +86,6 @@ impl VRRPv2 { pub fn to_bytes(&self) -> Result, std::io::Error> { let sz = MIN_PACKET_SIZE + (self.ip_addrs.len() * 4); let mut bytes: Vec = Vec::with_capacity(sz); - - // Write header bytes.push(VERSION_TYPE); bytes.push(self.virtual_router_id); bytes.push(self.priority); @@ -95,16 +93,10 @@ impl VRRPv2 { bytes.push(self.auth_type as u8); bytes.push(self.advertisement_interval); bytes.extend_from_slice(&[0, 0]); // Placeholder for checksum - - // Write IP addresses for ip in &self.ip_addrs { bytes.extend_from_slice(&ip.to_bits().to_be_bytes()); } - - // Write auth data - bytes.extend_from_slice(&[0; 8]); - - // Calculate and set checksum + bytes.extend_from_slice(&[0; 8]); // auth data let cksum = checksum(&bytes); let cksum_bytes = cksum.to_be_bytes(); bytes[6] = cksum_bytes[0]; -- cgit v1.2.3