]> git.meshlink.io Git - meshlink/blobdiff - src/net_socket.c
Change my email address.
[meshlink] / src / net_socket.c
index a41b887de35a29971c0fd6764a0dfed1e5666f97..6a769a3aeb883ad2d7de07be40e2d29a9141034b 100644 (file)
@@ -1,7 +1,7 @@
 /*
     net_socket.c -- Handle various kinds of sockets.
     Copyright (C) 1998-2005 Ivo Timmermans,
-                  2000-2013 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2014 Guus Sliepen <guus@meshlink.io>
                   2006      Scott Lamb <slamb@slamb.org>
                   2009      Florian Forster <octo@verplant.org>
 
 
 #include "conf.h"
 #include "connection.h"
-#include "control_common.h"
 #include "list.h"
 #include "logger.h"
 #include "meta.h"
-#include "names.h"
 #include "net.h"
 #include "netutl.h"
 #include "protocol.h"
@@ -49,9 +47,6 @@ int max_connection_burst = 100;
 
 listen_socket_t listen_socket[MAXSOCKETS];
 int listen_sockets;
-#ifndef HAVE_MINGW
-io_t unix_socket;
-#endif
 list_t *outgoing_list = NULL;
 
 /* Setup sockets */
@@ -362,8 +357,6 @@ static void do_outgoing_pipe(connection_t *c, char *command) {
        setenv("REMOTEPORT", port, true);
        setenv("NODE", c->name, true);
        setenv("NAME", myself->name, true);
-       if(netname)
-               setenv("NETNAME", netname, true);
 
        int result = system(command);
        if(result < 0)
@@ -703,45 +696,6 @@ void handle_new_meta_connection(void *data, int flags) {
        send_id(c);
 }
 
-#ifndef HAVE_MINGW
-/*
-  accept a new UNIX socket connection
-*/
-void handle_new_unix_connection(void *data, int flags) {
-       io_t *io = data;
-       connection_t *c;
-       sockaddr_t sa;
-       int fd;
-       socklen_t len = sizeof sa;
-
-       fd = accept(io->fd, &sa.sa, &len);
-
-       if(fd < 0) {
-               logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s", sockstrerror(sockerrno));
-               return;
-       }
-
-       sockaddrunmap(&sa);
-
-       c = new_connection();
-       c->name = xstrdup("<control>");
-       c->address = sa;
-       c->hostname = xstrdup("localhost port unix");
-       c->socket = fd;
-       c->last_ping_time = now.tv_sec;
-
-       logger(DEBUG_CONNECTIONS, LOG_NOTICE, "Connection from %s", c->hostname);
-
-       io_add(&c->io, handle_meta_io, c, c->socket, IO_READ);
-
-       connection_add(c);
-
-       c->allow_request = ID;
-
-       send_id(c);
-}
-#endif
-
 static void free_outgoing(outgoing_t *outgoing) {
        timeout_del(&outgoing->ev);