summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_unix.c32
-rw-r--r--src/transport/transport.conf.in2
2 files changed, 12 insertions, 22 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 9fc4ba735..56e1de426 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -50,13 +50,6 @@
*/
#define HOSTNAME_RESOLVE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-/**
- * Default "port" to use, if configuration does not specify.
- * Essentially just a number appended to the UNIX path.
- */
-#define UNIX_NAT_DEFAULT_PORT 22086
-
-
#define LOG(kind,...) GNUNET_log_from (kind, "transport-unix",__VA_ARGS__)
@@ -316,11 +309,6 @@ struct Plugin
*/
int with_ws;
- /**
- * Integer to append to unix domain socket.
- */
- uint16_t port;
-
};
@@ -1572,7 +1560,6 @@ void *
libgnunet_plugin_transport_unix_init (void *cls)
{
struct GNUNET_TRANSPORT_PluginEnvironment *env = cls;
- unsigned long long port;
struct GNUNET_TRANSPORT_PluginFunctions *api;
struct Plugin *plugin;
int sockets_created;
@@ -1588,16 +1575,19 @@ libgnunet_plugin_transport_unix_init (void *cls)
api->string_to_address = &unix_string_to_address;
return api;
}
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_number (env->cfg, "transport-unix", "PORT",
- &port))
- port = UNIX_NAT_DEFAULT_PORT;
+
plugin = GNUNET_new (struct Plugin);
- plugin->port = port;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename(env->cfg, "transport-unix", "UNIXPATH",
+ &plugin->unix_socket_path))
+ {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ _("No UNIXPATH given in configuration!\n"));
+ GNUNET_free (plugin);
+ return NULL;
+ }
+
plugin->env = env;
- GNUNET_asprintf (&plugin->unix_socket_path,
- "/tmp/unix-plugin-sock.%d",
- plugin->port);
/* Initialize my flags */
myoptions = 0;
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in
index 575f4dc20..00807c701 100644
--- a/src/transport/transport.conf.in
+++ b/src/transport/transport.conf.in
@@ -32,7 +32,7 @@ UNIX_MATCH_GID = YES
[transport-unix]
-PORT = 22086
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-transport-plugin-unix.sock
TESTING_IGNORE_KEYS = ACCEPT_FROM;
[transport-tcp]