Fixed parsing and printed length

This commit is contained in:
Dennis Schwerdel 2015-12-22 22:47:41 +01:00
parent 8930e21663
commit 112e531127
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,8 @@ This project follows [semantic versioning](http://semver.org).
- [fixed] Removing NULL-bytes from interface name
- [fixed] Supporting hostnames as peers
- [fixed] No longer encrypting multiple times
- [fixed] Properly decoding protocol header when sending
- [fixed] Corrected size of read data
### v0.4 (2015-12-22)

View File

@ -219,8 +219,8 @@ impl<P: Protocol> GenericCloud<P> {
}
fn handle_interface_data(&mut self, payload: &mut [u8], start: usize, end: usize) -> Result<(), Error> {
let (src, dst) = try!(P::parse(payload));
debug!("Read data from interface: src: {}, dst: {}, {} bytes", src, dst, payload.len());
let (src, dst) = try!(P::parse(&payload[start..end]));
debug!("Read data from interface: src: {}, dst: {}, {} bytes", src, dst, end-start);
match self.table.lookup(&dst) {
Some(addr) => {
debug!("Found destination for {} => {}", dst, addr);