Establish a unicast link to nodes who are filtering broadcasts

This commit is contained in:
Jeremy Lakeman 2013-05-29 11:48:48 +09:30
parent 50bcd3883b
commit bc50d3e184
3 changed files with 38 additions and 6 deletions

View File

@ -361,7 +361,6 @@ int send_please_explain(struct decode_context *context, struct subscriber *sourc
if (!context->sender)
frame->source_full=1;
frame->source->send_full=1;
frame->destination = destination;
if (destination && (destination->reachable & REACHABLE)){
@ -391,7 +390,8 @@ int process_explain(struct overlay_frame *frame){
struct decode_context context;
bzero(&context, sizeof context);
context.sender = frame->source;
while(ob_remaining(b)>0){
int len = ob_get(b);
if (len<=0 || len>SID_SIZE)

View File

@ -319,6 +319,10 @@ int parseEnvelopeHeader(struct decode_context *context, struct overlay_interface
overlay_send_probe(context->sender, *addr, interface, OQ_MESH_MANAGEMENT);
link_received_packet(context->sender, interface, context->sender_interface, sender_seq, packet_flags & PACKET_UNICAST);
}else{
// send a unicast probe, just incase they never hear our broadcasts.
if (addr)
overlay_send_probe(NULL, *addr, interface, OQ_MESH_MANAGEMENT);
}
if (addr){

View File

@ -18,6 +18,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Routing conditions that are known to not be working or covered by tests;
# - No support for multi-hop paths involving any unicast links
# - unicast only links need to be shared in the routing table
# - routing table needs to be shared to unicast only peers
# - unicast IP information should be shared among unicast peers
#
source "${0%/*}/../testframework.sh"
source "${0%/*}/../testdefs.sh"
@ -229,6 +237,26 @@ scan_completed() {
return 0
}
doc_single_filter="Single device with a broadcast filter"
setup_single_filter() {
setup_servald
assert_no_servald_processes
foreach_instance +A +B create_single_identity
foreach_instance +A +B add_interface 1
set_instance +B
executeOk_servald config \
set interfaces.1.dummy_address 127.0.1.11 \
set interfaces.1.drop_broadcasts 100
foreach_instance +A +B start_routing_instance
}
test_single_filter() {
wait_until path_exists +A +B
wait_until path_exists +B +A
set_instance +A
executeOk_servald mdp ping --timeout=3 $SIDB 1
tfw_cat --stdout --stderr
}
doc_broadcast_only="Broadcast packets only"
setup_broadcast_only() {
setup_servald
@ -240,8 +268,8 @@ setup_broadcast_only() {
foreach_instance +A +B start_routing_instance
}
test_broadcast_only() {
foreach_instance +A +B \
wait_until has_seen_instances +A +B
wait_until path_exists +A +B
wait_until path_exists +B +A
set_instance +A
executeOk_servald mdp ping --timeout=3 $SIDB 1
tfw_cat --stdout --stderr
@ -262,8 +290,8 @@ setup_prefer_unicast() {
foreach_instance +A +B start_routing_instance
}
test_prefer_unicast() {
foreach_instance +A +B \
wait_until has_seen_instances +A +B
wait_until path_exists +A +B
wait_until path_exists +B +A
set_instance +A
executeOk_servald mdp ping --timeout=3 $SIDB 1
tfw_cat --stdout --stderr