Commit e23f9a4b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use fixed mask_prefix.

parent 3bd27449
...@@ -172,10 +172,13 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -172,10 +172,13 @@ parse_packet(const unsigned char *from, struct network *net,
have_current_source = 1; have_current_source = 1;
if(memcmp(address, myid, 16) == 0) if(memcmp(address, myid, 16) == 0)
continue; continue;
if(plen <= 128) if(plen <= 128) {
update_route(address, mask_prefix(address, plen), plen, unsigned char prefix[16];
seqno, metric, neigh); mask_prefix(prefix, address, plen);
update_route(address, prefix, plen, seqno, metric, neigh);
}
} else if(type == 4) { } else if(type == 4) {
unsigned char prefix[16];
debugf("Received prefix %s on %s from %s (%s).\n", debugf("Received prefix %s on %s from %s (%s).\n",
format_prefix(address, plen), format_prefix(address, plen),
net->ifname, net->ifname,
...@@ -191,8 +194,8 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -191,8 +194,8 @@ parse_packet(const unsigned char *from, struct network *net,
} }
if(memcmp(current_source, myid, 16) == 0) if(memcmp(current_source, myid, 16) == 0)
continue; continue;
update_route(current_source, mask_prefix(address, plen), plen, mask_prefix(prefix, address, plen);
seqno, metric, neigh); update_route(current_source, prefix, plen, seqno, metric, neigh);
} else { } else {
debugf("Received unknown packet type %d from %s (%s).\n", debugf("Received unknown packet type %d from %s (%s).\n",
type, format_address(neigh->id), format_address(from)); type, format_address(neigh->id), format_address(from));
......
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