Commit 2be203f0 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Test all 64 bits of sender's link-local addresses.

Link-local addresses are defined as being in fe80::/10, but they always
start with 54 bits of zeroes.  Test the whole first byte.
parent a5ce4985
......@@ -135,8 +135,7 @@ parse_packet(const unsigned char *from, struct network *net,
unsigned char router_id[8], v4_prefix[16], v6_prefix[16],
v4_nh[16], v6_nh[16];
if(from[0] != 0xFE || (from[1] & 0xC0) != 0x80) {
if(!in_prefix(from, ll_prefix, 64)) {
fprintf(stderr, "Received packet from non-local address %s.\n",
format_address(from));
return;
......
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