From bc50d3e184043bd6b89731d1ab684422272e976a Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 29 May 2013 11:48:48 +0930 Subject: [PATCH] Establish a unicast link to nodes who are filtering broadcasts --- overlay_address.c | 4 ++-- overlay_packetformats.c | 4 ++++ tests/routing | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/overlay_address.c b/overlay_address.c index b7597302..fc9d7963 100644 --- a/overlay_address.c +++ b/overlay_address.c @@ -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) diff --git a/overlay_packetformats.c b/overlay_packetformats.c index 4fe75e7b..bc6de030 100644 --- a/overlay_packetformats.c +++ b/overlay_packetformats.c @@ -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){ diff --git a/tests/routing b/tests/routing index 695ab27c..f8144f4b 100755 --- a/tests/routing +++ b/tests/routing @@ -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