summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/Makefile.am1
-rw-r--r--ripngd/ripng_main.c14
-rw-r--r--ripngd/ripngd.h4
3 files changed, 13 insertions, 6 deletions
diff --git a/ripngd/Makefile.am b/ripngd/Makefile.am
index c6bd4868..ba52dba7 100644
--- a/ripngd/Makefile.am
+++ b/ripngd/Makefile.am
@@ -1,7 +1,6 @@
## Process this file with automake to produce Makefile.in.
INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @SNMP_INCLUDES@
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
AM_CFLAGS = $(PICFLAGS)
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 85209a15..54e3b69d 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -38,7 +38,7 @@
#include "ripngd/ripngd.h"
/* Configuration filename and directory. */
-char config_default[] = SYSCONFDIR RIPNG_DEFAULT_CONFIG;
+char config_default[MAXPATHLEN];
char *config_file = NULL;
/* RIPngd options. */
@@ -96,8 +96,11 @@ int vty_port = RIPNG_VTY_PORT;
/* Master of threads. */
struct thread_master *master;
+/* pid_file default value */
+static char pid_file_default[MAXPATHLEN];
+
/* Process ID saved for use by init system */
-const char *pid_file = PATH_RIPNGD_PID;
+const char *pid_file = pid_file_default;
/* Help information display. */
static void
@@ -137,7 +140,7 @@ sighup (void)
/* Reload config file. */
vty_read_config (config_file, config_default);
/* Create VTY's socket */
- vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, path_state (RIPNG_VTY_NAME));
/* Try to return to normal operation. */
}
@@ -263,6 +266,9 @@ main (int argc, char **argv)
}
}
+ strcpy (config_default, path_config (RIPNG_CONFIG_NAME));
+ strcpy (pid_file_default, path_state (RIPNG_PID_NAME));
+
master = thread_master_create ();
/* Library inits. */
@@ -295,7 +301,7 @@ main (int argc, char **argv)
}
/* Create VTY socket */
- vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, path_state (RIPNG_VTY_NAME));
/* Process id file create. */
pid_output (pid_file);
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
index ab06d81b..71615c3c 100644
--- a/ripngd/ripngd.h
+++ b/ripngd/ripngd.h
@@ -51,7 +51,9 @@
#define RIPNG_PEER_TIMER_DEFAULT 180
/* Default config file name. */
-#define RIPNG_DEFAULT_CONFIG "ripngd.conf"
+#define RIPNG_CONFIG_NAME "ripngd.conf"
+#define RIPNG_PID_NAME "ripngd.pid"
+#define RIPNG_VTY_NAME "ripngd.vty"
/* RIPng route types. */
#define RIPNG_ROUTE_RTE 0