]> git.meshlink.io Git - meshlink/commitdiff
Merge branch 'master' into dirtydebug dirtydebug
authorSaverio Proto <zioproto@gmail.com>
Sat, 12 Apr 2014 14:56:05 +0000 (16:56 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sat, 12 Apr 2014 14:56:05 +0000 (16:56 +0200)
1  2 
src/libmeshlink.c

diff --combined src/libmeshlink.c
index a1d23e53d983a970e22a8564d3e5a3f47da02bb9,e88b20c46d64dd2c8ea22826869617fbf96a45e4..c2fe1141addb2adab2ec5ae9e6109514e62f2e43
@@@ -39,7 -39,6 +39,6 @@@ static bool do_mlock = false
  */
  bool setup_meshlink_network(void) {
        init_connections();
-       init_subnets();
        init_nodes();
        init_edges();
        init_requests();
        if(!setup_myself())
                return false;
  
-       if(!init_control())
-               return false;
-       /* Run subnet-up scripts for our own subnets */
-       subnet_update(myself, NULL, true);
        return true;
  }
  
@@@ -388,8 -380,7 +380,7 @@@ int check_port(char *name) 
  }
  //tinc_setup() should basically do what cmd_init() from src/tincctl.c does, except it doesn't have to generate a tinc-up script.
  bool tinc_setup(const char* confbaseapi, const char* name) {
-       confbase = confbaseapi;
-       make_names();
+       confbase = xstrdup(confbaseapi);
          xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
          xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
        if(!access(tinc_conf, F_OK)) {
                return false;
        }
  
-       if(!confbase_given && mkdir(confdir, 0755) && errno != EEXIST) {
-               fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
-               return false;
-       }
        if(mkdir(confbase, 0777) && errno != EEXIST) {
                fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno));
                return false;
@@@ -445,15 -431,14 +431,14 @@@ return true
  }
  
  bool tinc_main_thread(void * in) {
+       static bool status = false;
  
- static bool status = false;
- /* If nonzero, write log entries to a separate file. */
- bool use_logfile = false;
+       /* If nonzero, write log entries to a separate file. */
+       bool use_logfile = false;
  
- confbase = (char*) in;
      confbase = (char*) in;
  
-       openlogger("tinc", use_logfile?LOGMODE_FILE:LOGMODE_STDERR);
+       openlogger("tinc", LOGMODE_STDERR);
  
        init_configuration(&config_tree);
  
@@@ -540,7 -525,6 +525,6 @@@ end
  
        exit_configuration(&config_tree);
        free(cmdline_conf);
-       free_names();
  
        return status;
  
@@@ -567,7 -551,6 +551,7 @@@ bool route_meshlink(node_t *source,vpn_
  
        if(!owner->status.reachable) {
        //Do some here
 +      printf("Owner un reachable\n");
        return false;
        }