]> git.meshlink.io Git - meshlink/commitdiff
Remove unused member variables.
authorGuus Sliepen <guus@meshlink.io>
Fri, 19 Jul 2019 16:54:40 +0000 (18:54 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 19 Jul 2019 16:55:51 +0000 (18:55 +0200)
In MeshLink, we are not using node/edge options, and we don't support
compression or setting a custom local discovery broadcast address.

Keep the internal support for meta-connections via proxies for now, even
though it currently isn't exposed via the API.

14 files changed:
src/connection.h
src/devtools.c
src/devtools.h
src/edge.h
src/graph.c
src/meshlink_internal.h
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/node.h
src/protocol_auth.c
src/protocol_edge.c
src/protocol_key.c
src/route.c

index 27513e975fbb1ef73e89b7abb573b5041769093c..fd633b3ffcb9e7535ba8c0263ff16dd938b07e62 100644 (file)
@@ -76,11 +76,6 @@ typedef struct connection_t {
        ecdsa_t *ecdsa;                 /* his public ECDSA key */
        int protocol_major;             /* used protocol */
        int protocol_minor;             /* used protocol */
-
-       // Unused/deprecated
-       uint32_t options;               /* options for this connection */
-       int incompression;
-       int outcompression;
 } connection_t;
 
 extern void init_connections(struct meshlink_handle *mesh);
index 5991d70cbbe5a1fb7af0c0998b17e18a2ab82bc1..cd45e39ff61e6a19047aae023e0ee19b964ea9d1 100644 (file)
@@ -86,7 +86,6 @@ devtool_edge_t *devtool_get_all_edges(meshlink_handle_t *mesh, devtool_edge_t *e
                        p->from = (meshlink_node_t *)e->from;
                        p->to = (meshlink_node_t *)e->to;
                        p->address = e->address.storage;
-                       p->options = e->options;
                        p->weight = e->weight;
 
                        n++;
@@ -161,10 +160,6 @@ bool devtool_export_json_all_edges_state(meshlink_handle_t *mesh, FILE *stream)
                        goto fail;
                }
 
-               if(!fstrwrite("\t\t\t\"options\": ", stream) || !fstrwrite(__itoa(((node_t *)nodes[i])->options), stream) || !fstrwrite(",\n", stream)) {
-                       goto fail;
-               }
-
                if(!fstrwrite("\t\t\t\"devclass\": ", stream) || !fstrwrite(__itoa(((node_t *)nodes[i])->devclass), stream) || !fstrwrite("\n", stream)) {
                        goto fail;
                }
@@ -214,10 +209,6 @@ bool devtool_export_json_all_edges_state(meshlink_handle_t *mesh, FILE *stream)
 
                free(address);
 
-               if(!fstrwrite("\t\t\t\"options\": ", stream) || !fstrwrite(__itoa(edges[i].options), stream) || !fstrwrite(",\n", stream)) {
-                       goto fail;
-               }
-
                if(!fstrwrite("\t\t\t\"weight\": ", stream) || !fstrwrite(__itoa(edges[i].weight), stream) || !fstrwrite("\n", stream)) {
                        goto fail;
                }
@@ -261,7 +252,6 @@ void devtool_get_node_status(meshlink_handle_t *mesh, meshlink_node_t *node, dev
 
        pthread_mutex_lock(&mesh->mesh_mutex);
 
-       status->options = internal->options;
        memcpy(&status->status, &internal->status, sizeof status->status);
        memcpy(&status->address, &internal->address, sizeof status->address);
        status->mtu = internal->mtu;
index 1a808e0465e7d08936ce0650d9a56408e5f39523..56b2afa4f3c6830b5afec674ee6f6a9e4bf1a0da 100644 (file)
@@ -41,7 +41,6 @@ struct devtool_edge {
        //   changed by meshlink.
        struct sockaddr_storage address;///< The address information associated
        //   with this edge.
-       uint32_t options;               ///< Edge options. @TODO what are edge options?
        int weight;                     ///< Weight assigned to this edge.
 };
 
@@ -87,7 +86,6 @@ typedef struct devtool_node_status devtool_node_status_t;
 
 /// The status of a node.
 struct devtool_node_status {
-       uint32_t options;
        uint32_t status;
        struct sockaddr_storage address;
        uint16_t mtu;
index c86acee34cf781a9305b613f32de006263ec41f9..2e59fa1de02da0a411787b82359ed855935c9dd5 100644 (file)
@@ -34,9 +34,6 @@ typedef struct edge_t {
        struct edge_t *reverse;                 /* edge in the opposite direction, if available */
 
        int weight;                             /* weight of this edge */
-
-       // Deprecated
-       uint32_t options;                       /* options turned on for this edge */
 } edge_t;
 
 extern void init_edges(struct meshlink_handle *mesh);
index d779ecd5f4144b2d6c92be41155924b5dbe56d02..1a1e237595076fd9bad0fe55e0ab3c6c60ffe699 100644 (file)
@@ -36,9 +36,9 @@
    For the SSSP algorithm Dijkstra's seems to be a nice choice. Currently a
    simple breadth-first search is presented here.
 
-   The SSSP algorithm will also be used to determine whether nodes are directly,
-   indirectly or not reachable from the source. It will also set the correct
-   destination address and port of a node if possible.
+   The SSSP algorithm will also be used to determine whether nodes are
+   reachable from the source. It will also set the correct destination address
+   and port of a node if possible.
 */
 
 #include "system.h"
@@ -126,17 +126,14 @@ static void sssp_bfs(meshlink_handle_t *mesh) {
 
        for splay_each(node_t, n, mesh->nodes) {
                n->status.visited = false;
-               n->status.indirect = true;
                n->distance = -1;
        }
 
        /* Begin with mesh->self */
 
        mesh->self->status.visited = true;
-       mesh->self->status.indirect = false;
        mesh->self->nexthop = mesh->self;
        mesh->self->prevedge = NULL;
-       mesh->self->via = mesh->self;
        mesh->self->distance = 0;
        list_insert_head(todo_list, mesh->self);
 
@@ -171,20 +168,14 @@ static void sssp_bfs(meshlink_handle_t *mesh) {
                             of nodes behind it.
                         */
 
-                       bool indirect = n->status.indirect || e->options & OPTION_INDIRECT;
-
                        if(e->to->status.visited
-                                       && (!e->to->status.indirect || indirect)
                                        && (e->to->distance != n->distance + 1 || e->weight >= e->to->prevedge->weight)) {
                                continue;
                        }
 
                        e->to->status.visited = true;
-                       e->to->status.indirect = indirect;
                        e->to->nexthop = (n->nexthop == mesh->self) ? e->to : n->nexthop;
                        e->to->prevedge = e;
-                       e->to->via = indirect ? n->via : e->to;
-                       e->to->options = e->options;
                        e->to->distance = n->distance + 1;
 
                        if(!e->to->status.reachable || (e->to->address.sa.sa_family == AF_UNSPEC && e->address.sa.sa_family != AF_UNKNOWN)) {
@@ -236,7 +227,6 @@ static void check_reachability(meshlink_handle_t *mesh) {
                        if(!n->status.reachable) {
                                update_node_udp(mesh, n, NULL);
                                n->status.broadcast = false;
-                               n->options = 0;
                        } else if(n->connection) {
                                if(n->connection->outgoing) {
                                        send_req_key(mesh, n);
index c711aa57d8863eb67b2ee82852a39d00dd842319..94e8b7983d00e12a637cd78dc945c21f829e9952 100644 (file)
@@ -175,14 +175,12 @@ struct meshlink_handle {
        char line[4096];
        char buffer[4096];
 
-       // Unused variables
+       // Proxy configuration, currently not exposed.
        char *proxyhost;
        char *proxyport;
        char *proxyuser;
        char *proxypass;
        proxytype_t proxytype;
-       sockaddr_t localdiscovery_address;
-       bool localdiscovery;
 };
 
 /// A handle for a MeshLink node.
index f0c4e9802bd46649a175995b65c1cd2c264ebc7c..36ad02bcf7b19fbfe05d19184b11be8f96e6d20d 100644 (file)
@@ -105,7 +105,7 @@ static void send_mtu_probe_handler(event_loop_t *loop, void *data) {
                timeout = mesh->pingtimeout;
        }
 
-       for(int i = 0; i < 4 + mesh->localdiscovery; i++) {
+       for(int i = 0; i < 5; i++) {
                int len;
 
                if(i == 0) {
@@ -261,11 +261,6 @@ static void send_sptps_packet(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *
                return;
        }
 
-       if(n->outcompression) {
-               logger(mesh, MESHLINK_ERROR, "Error while compressing packet to %s", n->name);
-               return;
-       }
-
        sptps_send_record(&n->sptps, type, origpkt->data, origpkt->len);
        return;
 }
@@ -341,22 +336,12 @@ static void choose_broadcast_address(meshlink_handle_t *mesh, const node_t *n, c
        *sock = rand() % mesh->listen_sockets;
 
        if(mesh->listen_socket[*sock].sa.sa.sa_family == AF_INET6) {
-               if(mesh->localdiscovery_address.sa.sa_family == AF_INET6) {
-                       mesh->localdiscovery_address.in6.sin6_port = n->prevedge->address.in.sin_port;
-                       *sa = &mesh->localdiscovery_address;
-               } else {
-                       broadcast_ipv6.in6.sin6_port = n->prevedge->address.in.sin_port;
-                       broadcast_ipv6.in6.sin6_scope_id = mesh->listen_socket[*sock].sa.in6.sin6_scope_id;
-                       *sa = &broadcast_ipv6;
-               }
+               broadcast_ipv6.in6.sin6_port = n->prevedge->address.in.sin_port;
+               broadcast_ipv6.in6.sin6_scope_id = mesh->listen_socket[*sock].sa.in6.sin6_scope_id;
+               *sa = &broadcast_ipv6;
        } else {
-               if(mesh->localdiscovery_address.sa.sa_family == AF_INET) {
-                       mesh->localdiscovery_address.in.sin_port = n->prevedge->address.in.sin_port;
-                       *sa = &mesh->localdiscovery_address;
-               } else {
-                       broadcast_ipv4.in.sin_port = n->prevedge->address.in.sin_port;
-                       *sa = &broadcast_ipv4;
-               }
+               broadcast_ipv4.in.sin_port = n->prevedge->address.in.sin_port;
+               *sa = &broadcast_ipv4;
        }
 }
 
@@ -375,15 +360,14 @@ bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len) {
 
        /* Send it via TCP if it is a handshake packet, TCPOnly is in use, or this packet is larger than the MTU. */
 
-       if(type >= SPTPS_HANDSHAKE || ((mesh->self->options | to->options) & OPTION_TCPONLY) || (type != PKT_PROBE && len > to->minmtu)) {
+       if(type >= SPTPS_HANDSHAKE || (type != PKT_PROBE && len > to->minmtu)) {
                char buf[len * 4 / 3 + 5];
                b64encode(data, buf, len);
 
                /* If no valid key is known yet, send the packets using ANS_KEY requests,
                   to ensure we get to learn the reflexive UDP address. */
                if(!to->status.validkey) {
-                       to->incompression = mesh->self->incompression;
-                       return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, to->incompression);
+                       return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, 0);
                } else {
                        return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %d %s", REQ_KEY, mesh->self->name, to->name, REQ_SPTPS, buf);
                }
index 52f5e820ffcf8c40e884e5f9c9cf9190f6a91fa2..f50f39cd2c07c7199d9a273bda46f83e38a43d6c 100644 (file)
@@ -395,15 +395,12 @@ static bool add_listen_address(meshlink_handle_t *mesh, char *address, bool bind
 bool setup_myself(meshlink_handle_t *mesh) {
        /* Set some defaults */
 
-       mesh->localdiscovery = true;
        keylifetime = 3600; // TODO: check if this can be removed as well
        mesh->maxtimeout = 900;
-       mesh->self->options |= OPTION_PMTU_DISCOVERY;
 
        /* Done */
 
        mesh->self->nexthop = mesh->self;
-       mesh->self->via = mesh->self;
        mesh->self->status.reachable = true;
        mesh->self->last_state_change = mesh->loop.now.tv_sec;
 
index 36fa57044d0fe0fe167be36e9bd5e0207addc509..b5505500ebd18d7a60bdfd02895e6f7826ad24d9 100644 (file)
@@ -213,39 +213,19 @@ int setup_vpn_in_socket(meshlink_handle_t *mesh, const sockaddr_t *sa) {
 #endif
 
 #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DO)
-
-       if(mesh->self->options & OPTION_PMTU_DISCOVERY) {
-               option = IP_PMTUDISC_DO;
-               setsockopt(nfd, IPPROTO_IP, IP_MTU_DISCOVER, (void *)&option, sizeof(option));
-       }
-
+       option = IP_PMTUDISC_DO;
+       setsockopt(nfd, IPPROTO_IP, IP_MTU_DISCOVER, (void *)&option, sizeof(option));
 #elif defined(IP_DONTFRAGMENT)
-
-       if(mesh->self->options & OPTION_PMTU_DISCOVERY) {
-               option = 1;
-               setsockopt(nfd, IPPROTO_IP, IP_DONTFRAGMENT, (void *)&option, sizeof(option));
-       }
-
-#else
-#warning No way to disable IPv4 fragmentation
+       option = 1;
+       setsockopt(nfd, IPPROTO_IP, IP_DONTFRAGMENT, (void *)&option, sizeof(option));
 #endif
 
 #if defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO)
-
-       if(mesh->self->options & OPTION_PMTU_DISCOVERY) {
-               option = IPV6_PMTUDISC_DO;
-               setsockopt(nfd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, (void *)&option, sizeof(option));
-       }
-
+       option = IPV6_PMTUDISC_DO;
+       setsockopt(nfd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, (void *)&option, sizeof(option));
 #elif defined(IPV6_DONTFRAG)
-
-       if(mesh->self->options & OPTION_PMTU_DISCOVERY) {
-               option = 1;
-               setsockopt(nfd, IPPROTO_IPV6, IPV6_DONTFRAG, (void *)&option, sizeof(option));
-       }
-
-#else
-#warning No way to disable IPv6 fragmentation
+       option = 1;
+       setsockopt(nfd, IPPROTO_IPV6, IPV6_DONTFRAG, (void *)&option, sizeof(option));
 #endif
 
        if(bind(nfd, &sa->sa, SALEN(sa->sa))) {
index f03afb2551ace2db99df0d646b1a46b829685e58..dc15e3f299f9c2767fa06a5b23ca95ae390a05d4 100644 (file)
@@ -31,7 +31,6 @@ typedef struct node_status_t {
        uint16_t waitingforkey: 1;          /* 1 if we already sent out a request */
        uint16_t visited: 1;                /* 1 if this node has been visited by one of the graph algorithms */
        uint16_t reachable: 1;              /* 1 if this node is reachable in the graph */
-       uint16_t indirect: 1;               /* 1 if this node is not directly reachable by us */
        uint16_t udp_confirmed: 1;          /* 1 if the address is one that we received UDP traffic on */
        uint16_t broadcast: 1;              /* 1 if the next UDP packet should be broadcast to the local network */
        uint16_t blacklisted: 1;            /* 1 if the node is blacklist so we never want to speak with him anymore */
@@ -89,14 +88,8 @@ typedef struct node_t {
        int distance;
        struct node_t *nexthop;                 /* nearest node from us to him */
        struct edge_t *prevedge;                /* nearest node from him to us */
-       struct node_t *via;                     /* next hop for UDP packets */
 
        struct splay_tree_t *edge_tree;         /* Edges with this node as one of the endpoints */
-
-       // Unused
-       uint32_t options;                       /* options turned on for this node */
-       int incompression;                      /* Compressionlevel, 0 = no compression */
-       int outcompression;                     /* Compressionlevel, 0 = no compression */
 } node_t;
 
 extern void init_nodes(struct meshlink_handle *mesh);
index e2fe28b40d972d68a5a8023d5c4cef71045599f0..e9aa0c51ddb4370bf4ba4135c92224e434e5845b 100644 (file)
@@ -371,14 +371,7 @@ bool id_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
 }
 
 bool send_ack(meshlink_handle_t *mesh, connection_t *c) {
-
-       /* Check some options */
-
-       if(mesh->self->options & OPTION_PMTU_DISCOVERY) {
-               c->options |= OPTION_PMTU_DISCOVERY;
-       }
-
-       return send_request(mesh, c, NULL, "%d %s %d %x", ACK, mesh->myport, mesh->devclass, (c->options & 0xffffff) | (PROT_MINOR << 24));
+       return send_request(mesh, c, NULL, "%d %s %d %x", ACK, mesh->myport, mesh->devclass, OPTION_PMTU_DISCOVERY | (PROT_MINOR << 24));
 }
 
 static void send_everything(meshlink_handle_t *mesh, connection_t *c) {
@@ -444,13 +437,6 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        n->connection = c;
        c->node = n;
 
-       if(!(c->options & options & OPTION_PMTU_DISCOVERY)) {
-               c->options &= ~OPTION_PMTU_DISCOVERY;
-               options &= ~OPTION_PMTU_DISCOVERY;
-       }
-
-       c->options |= options;
-
        /* Activate this connection */
 
        c->allow_request = ALL;
@@ -472,7 +458,6 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        sockaddrcpy_setport(&c->edge->address, &c->address, atoi(hisport));
        c->edge->weight = dev_class_traits[devclass].edge_weight;
        c->edge->connection = c;
-       c->edge->options = c->options;
 
        edge_add(mesh, c->edge);
 
index b5de2821c8d28f7c303510fcce26840aa0ff6337..405961ed7f508791b179aae761e91c91ca695d37 100644 (file)
@@ -76,7 +76,7 @@ bool send_add_edge(meshlink_handle_t *mesh, connection_t *c, const edge_t *e, in
 
        x = send_request(mesh, c, s, "%d %x %s %d %s %s %s %s %d %s %x %d %d", ADD_EDGE, rand(),
                         e->from->name, e->from->devclass, from_submesh, e->to->name, address, port,
-                        e->to->devclass, to_submesh, e->options, e->weight, contradictions);
+                        e->to->devclass, to_submesh, OPTION_PMTU_DISCOVERY, e->weight, contradictions);
        free(address);
        free(port);
 
@@ -95,14 +95,13 @@ bool add_edge_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        int to_devclass;
        char to_submesh_name[MAX_STRING_SIZE] = "";
        sockaddr_t address;
-       uint32_t options;
        int weight;
        int contradictions = 0;
        submesh_t *s = NULL;
 
-       if(sscanf(request, "%*d %*x "MAX_STRING" %d "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %d "MAX_STRING" %x %d %d",
+       if(sscanf(request, "%*d %*x "MAX_STRING" %d "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %d "MAX_STRING" %*x %d %d",
                        from_name, &from_devclass, from_submesh_name, to_name, to_address, to_port, &to_devclass, to_submesh_name,
-                       &options, &weight, &contradictions) < 10) {
+                       &weight, &contradictions) < 9) {
                logger(mesh, MESHLINK_ERROR, "Got bad %s from %s", "ADD_EDGE", c->name);
                return false;
        }
@@ -190,7 +189,7 @@ bool add_edge_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        e = lookup_edge(from, to);
 
        if(e) {
-               if(e->weight != weight || e->options != options || sockaddrcmp(&e->address, &address)) {
+               if(e->weight != weight || sockaddrcmp(&e->address, &address)) {
                        if(from == mesh->self) {
                                logger(mesh, MESHLINK_WARNING, "Got %s from %s for ourself which does not match existing entry",
                                       "ADD_EDGE", c->name);
@@ -221,7 +220,6 @@ bool add_edge_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        e->from = from;
        e->to = to;
        e->address = address;
-       e->options = options;
        e->weight = weight;
        edge_add(mesh, e);
 
index 64a0ce8faff20b743ed81740d925fe613dd04793..179252984e1c3856947ba2569a86ba6e6d2b324c 100644 (file)
@@ -96,7 +96,6 @@ bool send_req_key(meshlink_handle_t *mesh, node_t *to) {
        to->status.validkey = false;
        to->status.waitingforkey = true;
        to->last_req_key = mesh->loop.now.tv_sec;
-       to->incompression = mesh->self->incompression;
        return sptps_start(&to->sptps, to, true, true, mesh->private_key, to->ecdsa, label, sizeof(label) - 1, send_initial_sptps_data, receive_sptps_record);
 }
 
@@ -335,8 +334,6 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
                return true;
        }
 
-       from->outcompression = compression;
-
        /* SPTPS or old-style key exchange? */
 
        char buf[strlen(key)];
@@ -353,9 +350,7 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
                        update_node_udp(mesh, from, &sa);
                }
 
-               if(from->options & OPTION_PMTU_DISCOVERY && !(from->options & OPTION_TCPONLY)) {
-                       send_mtu_probe(mesh, from);
-               }
+               send_mtu_probe(mesh, from);
        }
 
        return true;
index 77e018e9f6014cb46b8ef1158c3747b1cc954404..9255712e22682d06759ec98efc094036240fe60c 100644 (file)
@@ -39,10 +39,8 @@ static bool checklength(node_t *source, vpn_packet_t *packet, uint16_t length) {
 void route(meshlink_handle_t *mesh, node_t *source, vpn_packet_t *packet) {
        // TODO: route on name or key
 
-       node_t *owner = NULL;
-       node_t *via = NULL;
        meshlink_packethdr_t *hdr = (meshlink_packethdr_t *) packet->data;
-       owner = lookup_node(mesh, (char *)hdr->destination);
+       node_t *dest = lookup_node(mesh, (char *)hdr->destination);
        logger(mesh, MESHLINK_DEBUG, "Routing packet from \"%s\" to \"%s\"\n", hdr->source, hdr->destination);
 
        //Check Length
@@ -50,14 +48,14 @@ void route(meshlink_handle_t *mesh, node_t *source, vpn_packet_t *packet) {
                return;
        }
 
-       if(owner == NULL) {
+       if(dest == NULL) {
                //Lookup failed
-               logger(mesh, MESHLINK_WARNING, "Can't lookup the owner of a packet in the route() function. This should never happen!\n");
+               logger(mesh, MESHLINK_WARNING, "Can't lookup the destination of a packet in the route() function. This should never happen!\n");
                logger(mesh, MESHLINK_WARNING, "Destination was: %s\n", hdr->destination);
                return;
        }
 
-       if(owner == mesh->self) {
+       if(dest == mesh->self) {
                const void *payload = packet->data + sizeof(*hdr);
                size_t len = packet->len - sizeof(*hdr);
 
@@ -76,19 +74,17 @@ void route(meshlink_handle_t *mesh, node_t *source, vpn_packet_t *packet) {
                return;
        }
 
-       if(!owner->status.reachable) {
+       if(!dest->status.reachable) {
                //TODO: check what to do here, not just print a warning
-               logger(mesh, MESHLINK_WARNING, "The owner of a packet in the route() function is unreachable. Dropping packet.\n");
+               logger(mesh, MESHLINK_WARNING, "The destination of a packet in the route() function is unreachable. Dropping packet.\n");
                return;
        }
 
-       via = (owner->via == mesh->self) ? owner->nexthop : owner->via;
-
-       if(via == source) {
+       if(dest == source) {
                logger(mesh, MESHLINK_ERROR, "Routing loop for packet from %s!", source->name);
                return;
        }
 
-       send_packet(mesh, owner, packet);
+       send_packet(mesh, dest, packet);
        return;
 }