From 7e5a886a0b9fdea0c9d37d67c5345e6d23b417e9 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Sat, 11 Aug 2018 16:39:35 -0700 Subject: [PATCH 1/3] doc: Add missing flowspec.rst to distribution tar file Signed-off-by: Martin Winter --- doc/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Makefile.am b/doc/Makefile.am index da8ac3d050..fbceb8b04c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -234,6 +234,7 @@ EXTRA_DIST = frr-sphinx.mk \ user/vnc.rst \ user/vtysh.rst \ user/zebra.rst \ + user/flowspec.rst \ mpls/ChangeLog.opaque.txt \ mpls/ospfd.conf \ mpls/cli_summary.txt \ From 45d005874e5a7aeec9c3057e5db407ab84f16145 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Mon, 13 Aug 2018 14:52:21 -0700 Subject: [PATCH 2/3] vtysh: Fix missing tailing / in --config_dir option parsing Signed-off-by: Martin Winter --- vtysh/vtysh_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index 7d882620e8..86fa62f474 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -356,7 +356,7 @@ int main(int argc, char **argv, char **env) break; case OPTION_CONFDIR: ditch_suid = 1; /* option disables SUID */ - strlcpy(sysconfdir, optarg, sizeof(sysconfdir)); + snprintf(sysconfdir, sizeof(sysconfdir), "%s/", optarg); break; case 'N': if (strchr(optarg, '/') || strchr(optarg, '.')) { From 138aa674c23675911fffa1568defa776ee864fba Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Sat, 11 Aug 2018 16:44:27 -0700 Subject: [PATCH 3/3] snapcraft: Add new staticd to snap package Signed-off-by: Martin Winter --- snapcraft/defaults/staticd.conf.default | 0 snapcraft/scripts/Makefile | 1 + snapcraft/scripts/staticd-service | 20 ++++++++++++++++++++ snapcraft/snapcraft.yaml.in | 9 +++++++++ 4 files changed, 30 insertions(+) create mode 100644 snapcraft/defaults/staticd.conf.default create mode 100644 snapcraft/scripts/staticd-service diff --git a/snapcraft/defaults/staticd.conf.default b/snapcraft/defaults/staticd.conf.default new file mode 100644 index 0000000000..e69de29bb2 diff --git a/snapcraft/scripts/Makefile b/snapcraft/scripts/Makefile index 110f4b2878..9a476c6e58 100644 --- a/snapcraft/scripts/Makefile +++ b/snapcraft/scripts/Makefile @@ -15,6 +15,7 @@ install: install -D -m 0755 babeld-service $(DESTDIR)/bin/ install -D -m 0755 eigrpd-service $(DESTDIR)/bin/ install -D -m 0755 pbrd-service $(DESTDIR)/bin/ + install -D -m 0755 staticd-service $(DESTDIR)/bin/ install -D -m 0755 set-options $(DESTDIR)/bin/ install -D -m 0755 show_version $(DESTDIR)/bin/ diff --git a/snapcraft/scripts/staticd-service b/snapcraft/scripts/staticd-service new file mode 100644 index 0000000000..3b22881640 --- /dev/null +++ b/snapcraft/scripts/staticd-service @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e -x + +if ! [ -e $SNAP_DATA/staticd.conf ]; then + if [ -e $SNAP_DATA/zebra.conf ]; then + # if we have a zebra.conf, but no staticd conf, then we use + # this file as the default config for staticd + cp $SNAP_DATA/zebra.conf $SNAP_DATA/staticd.conf + else + # new config, start with template + cp $SNAP/etc/frr/staticd.conf $SNAP_DATA/staticd.conf + fi +fi +exec $SNAP/sbin/staticd \ + -f $SNAP_DATA/staticd.conf \ + --pid_file $SNAP_DATA/staticd.pid \ + --socket $SNAP_DATA/zsock \ + --vty_socket $SNAP_DATA + diff --git a/snapcraft/snapcraft.yaml.in b/snapcraft/snapcraft.yaml.in index b4e1812c86..48dc69278b 100644 --- a/snapcraft/snapcraft.yaml.in +++ b/snapcraft/snapcraft.yaml.in @@ -113,6 +113,13 @@ apps: - network - network-bind - network-control + staticd: + command: bin/staticd-service + daemon: simple + plugs: + - network + - network-bind + - network-control set: command: bin/set-options zebra-debug: @@ -193,6 +200,8 @@ apps: - network - network-bind - network-control + staticd-debug: + command: sbin/staticd -f $SNAP_DATA/staticd.conf --pid_file $SNAP_DATA/staticd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA parts: frr: