You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.9 KiB

  1. From 354196c027e81affb05163a6c3676eef1ba06dd9 Mon Sep 17 00:00:00 2001
  2. From: Zoran Pericic <zpericic@netst.org>
  3. Date: Sat, 25 Jan 2020 19:38:39 +0100
  4. Subject: [PATCH] nhrp: Make vici socket path configurable
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. nhrp: Configure vici socket path using
  9. configure --with-vici-socket=/var/run/charon.vici
  10. If not specified default to /var/run/charon.vici
  11. Signed-off-by: Zoran Peričić <zpericic@netst.org>
  12. ---
  13. configure.ac | 8 ++++++++
  14. doc/user/installation.rst | 4 ++++
  15. nhrpd/README.nhrpd | 3 ++-
  16. nhrpd/vici.c | 2 +-
  17. 4 files changed, 15 insertions(+), 2 deletions(-)
  18. --- a/configure.ac
  19. +++ b/configure.ac
  20. @@ -139,6 +139,13 @@ AC_ARG_WITH([yangmodelsdir], [AS_HELP_ST
  21. ])
  22. AC_SUBST([yangmodelsdir])
  23. +AC_ARG_WITH([vici-socket], [AS_HELP_STRING([--with-vici-socket=PATH], [vici-socket (/var/run/charon.vici)])], [
  24. + vici_socket="$withval"
  25. +], [
  26. + vici_socket="/var/run/charon.vici"
  27. +])
  28. +AC_DEFINE_UNQUOTED([VICI_SOCKET], ["$vici_socket"], [StrongSWAN vici socket path])
  29. +
  30. AC_ARG_ENABLE(tcmalloc,
  31. AS_HELP_STRING([--enable-tcmalloc], [Turn on tcmalloc]),
  32. [case "${enableval}" in
  33. @@ -2480,6 +2487,7 @@ group for vty sockets : ${enable_vty_g
  34. config file mask : ${enable_configfile_mask}
  35. log file mask : ${enable_logfile_mask}
  36. zebra protobuf enabled : ${enable_protobuf:-no}
  37. +vici socket path : ${vici_socket}
  38. The above user and group must have read/write access to the state file
  39. directory and to the config files in the config file directory."
  40. --- a/doc/user/installation.rst
  41. +++ b/doc/user/installation.rst
  42. @@ -383,6 +383,10 @@ options to the configuration script.
  43. Look for YANG modules in `dir` [`prefix`/share/yang]. Note that the FRR
  44. YANG modules will be installed here.
  45. +.. option:: --with-vici-socket <path>
  46. +
  47. + Set StrongSWAN vici interface socket path [/var/run/charon.vici].
  48. +
  49. Python dependency, documentation and tests
  50. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  51. --- a/nhrpd/README.nhrpd
  52. +++ b/nhrpd/README.nhrpd
  53. @@ -126,7 +126,8 @@ Integration with strongSwan
  54. Contrary to opennhrp, Quagga/NHRP has tight integration with IKE daemon.
  55. Currently strongSwan is supported using the VICI protocol. strongSwan
  56. -is connected using UNIX socket (hardcoded now as /var/run/charon.vici).
  57. +is connected using UNIX socket (default /var/run/charon.vici use configure
  58. +argument --with-vici-socket= to change).
  59. Thus nhrpd needs to be run as user that can open that file.
  60. Currently, you will need patched strongSwan. The working tree is at:
  61. --- a/nhrpd/vici.c
  62. +++ b/nhrpd/vici.c
  63. @@ -478,7 +478,7 @@ static int vici_reconnect(struct thread
  64. if (vici->fd >= 0)
  65. return 0;
  66. - fd = sock_open_unix("/var/run/charon.vici");
  67. + fd = sock_open_unix(VICI_SOCKET);
  68. if (fd < 0) {
  69. debugf(NHRP_DEBUG_VICI,
  70. "%s: failure connecting VICI socket: %s", __func__,