Commit 0a4d495f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Check version before accepting packet.

parent 2ec504a4
...@@ -78,6 +78,13 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -78,6 +78,13 @@ parse_packet(const unsigned char *from, struct network *net,
return; return;
} }
if(packet[1] != 0) {
fprintf(stderr,
"Received packet with unknown version %d on %s from %s.\n",
packet[1], net->ifname, format_address(from));
return;
}
j = 0; j = 0;
for(i = 0; i < (len - 4) / 20; i++) { for(i = 0; i < (len - 4) / 20; i++) {
message = packet + 4 + 20 * i; message = packet + 4 + 20 * i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment