Commit 1315ceac authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Protect against add_neighbour failing.

parent 464c1e86
...@@ -105,6 +105,8 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -105,6 +105,8 @@ parse_packet(const unsigned char *from, struct network *net,
format_address(from)); format_address(from));
net->activity_time = now.tv_sec; net->activity_time = now.tv_sec;
neigh = add_neighbour(message + 4, from, net); neigh = add_neighbour(message + 4, from, net);
if(neigh == NULL)
continue;
update_neighbour(neigh, message[1], update_neighbour(neigh, message[1],
((message[2] & 0x3) << 8) | message[3]); ((message[2] & 0x3) << 8) | message[3]);
update_neighbour_metric(neigh); update_neighbour_metric(neigh);
......
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