Commit 0bffdbe3 authored by Matthieu Boutier's avatar Matthieu Boutier Committed by Juliusz Chroboczek

Format source-specific wildcard unicast requests.

parent 9ba2198b
...@@ -1835,17 +1835,39 @@ send_unicast_request(struct neighbour *neigh, ...@@ -1835,17 +1835,39 @@ send_unicast_request(struct neighbour *neigh,
/* make sure any buffered updates go out before this request. */ /* make sure any buffered updates go out before this request. */
flushupdates(neigh->ifp); flushupdates(neigh->ifp);
if(!prefix) if(prefix && src_prefix) {
debugf("sending unicast request to %s for any.\n",
format_address(neigh->address));
else
debugf("sending unicast request to %s for %s from %s.\n", debugf("sending unicast request to %s for %s from %s.\n",
format_address(neigh->address), format_address(neigh->address),
format_prefix(prefix, plen), format_prefix(prefix, plen),
format_prefix(src_prefix, src_plen)); format_prefix(src_prefix, src_plen));
} else if (prefix) {
debugf("sending unicast request to %s for any specific.\n",
format_address(neigh->address));
rc = start_unicast_message(neigh, MESSAGE_REQUEST_SRC_SPECIFIC, 3);
if(rc < 0) return;
accumulate_unicast_byte(neigh, 0);
accumulate_unicast_byte(neigh, 0);
accumulate_unicast_byte(neigh, 0);
end_unicast_message(neigh, MESSAGE_REQUEST_SRC_SPECIFIC, 3);
return;
} else if (src_prefix) {
debugf("sending unicast request to %s for any.\n",
format_address(neigh->address));
rc = start_unicast_message(neigh, MESSAGE_REQUEST, 2);
if(rc < 0) return;
accumulate_unicast_byte(neigh, 0);
accumulate_unicast_byte(neigh, 0);
end_unicast_message(neigh, MESSAGE_REQUEST, 2);
return;
} else {
send_unicast_request(neigh, NULL, 0, zeroes, 0);
send_unicast_request(neigh, zeroes, 0, NULL, 0);
return;
}
v4 = plen >= 96 && v4mapped(prefix); v4 = plen >= 96 && v4mapped(prefix);
pb = v4 ? ((plen - 96) + 7) / 8 : (plen + 7) / 8; pb = v4 ? ((plen - 96) + 7) / 8 : (plen + 7) / 8;
len = !prefix ? 2 : 2 + pb; len = 2 + pb;
if(src_plen != 0) { if(src_plen != 0) {
spb = v4 ? ((src_plen - 96) + 7) / 8 : (src_plen + 7) / 8; spb = v4 ? ((src_plen - 96) + 7) / 8 : (src_plen + 7) / 8;
...@@ -1855,16 +1877,14 @@ send_unicast_request(struct neighbour *neigh, ...@@ -1855,16 +1877,14 @@ send_unicast_request(struct neighbour *neigh,
rc = start_unicast_message(neigh, MESSAGE_REQUEST, len); rc = start_unicast_message(neigh, MESSAGE_REQUEST, len);
} }
if(rc < 0) return; if(rc < 0) return;
accumulate_unicast_byte(neigh, !prefix ? 0 : v4 ? 1 : 2); accumulate_unicast_byte(neigh, v4 ? 1 : 2);
accumulate_unicast_byte(neigh, !prefix ? 0 : v4 ? plen - 96 : plen); accumulate_unicast_byte(neigh, v4 ? plen - 96 : plen);
if(src_plen != 0) if(src_plen != 0)
accumulate_unicast_byte(neigh, v4 ? src_plen - 96 : src_plen); accumulate_unicast_byte(neigh, v4 ? src_plen - 96 : src_plen);
if(prefix) { if(v4)
if(v4) accumulate_unicast_bytes(neigh, prefix + 12, pb);
accumulate_unicast_bytes(neigh, prefix + 12, pb); else
else accumulate_unicast_bytes(neigh, prefix, pb);
accumulate_unicast_bytes(neigh, prefix, pb);
}
if(src_plen != 0) { if(src_plen != 0) {
if(v4) if(v4)
accumulate_unicast_bytes(neigh, src_prefix + 12, spb); accumulate_unicast_bytes(neigh, src_prefix + 12, spb);
......
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