diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/vrrpv2.rs | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs index 9a08801..c9d5031 100644 --- a/src/vrrpv2.rs +++ b/src/vrrpv2.rs @@ -102,7 +102,7 @@ impl VRRPv2 {          let sz = (4 + self.count_ip_addrs) * 4;          let bytes: Vec<u8> = Vec::with_capacity(sz.into());          let mut wr = Cursor::new(bytes); -        wr.write( +        wr.write_all(              [                  0x21,                  self.virtual_router_id, @@ -111,13 +111,13 @@ impl VRRPv2 {              ]              .as_ref(),          )?; -        wr.write([self.auth_type as u8, self.advertisement_interval].as_ref())?; -        wr.write(self.checksum.to_be_bytes().as_ref())?; +        wr.write_all([self.auth_type as u8, self.advertisement_interval].as_ref())?; +        wr.write_all(self.checksum.to_be_bytes().as_ref())?;          for ip in self.ip_addrs.iter() { -            wr.write(&ip.to_bits().to_be_bytes())?; +            wr.write_all(&ip.to_bits().to_be_bytes())?;          } -        wr.write([0; 4].as_ref())?; // Authentication Data 1 -        wr.write([0; 4].as_ref())?; // Authentication Data 2 +        wr.write_all([0; 4].as_ref())?; // Authentication Data 1 +        wr.write_all([0; 4].as_ref())?; // Authentication Data 2          Ok(wr.into_inner())      }  } | 
