mirror of
https://github.com/haileys/bark
synced 2024-11-13 23:37:08 +00:00
check magic in receive
This commit is contained in:
parent
700afda7e6
commit
df96bcaa68
1 changed files with 5 additions and 0 deletions
|
@ -67,6 +67,11 @@ impl Receiver {
|
|||
}
|
||||
|
||||
pub fn push_packet(&mut self, packet: &Packet) {
|
||||
if packet.magic != protocol::MAGIC {
|
||||
eprintln!("ignoring packet with bad magic");
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(start) = self.start.as_mut() {
|
||||
if packet.seq < start.seq {
|
||||
eprintln!("received packet with seq before start, dropping");
|
||||
|
|
Loading…
Reference in a new issue