diff options
-rw-r--r-- | .gitlab-ci.yml | 41 | ||||
-rw-r--r-- | conf/conf.c | 17 | ||||
-rw-r--r-- | conf/conf.h | 1 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/bird.sgml | 5 | ||||
-rw-r--r-- | sysdep/unix/main.c | 7 |
6 files changed, 71 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a758cff..02d0a66a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ variables: DOCKER_CMD: docker --config="$HOME/.docker/$CI_JOB_ID/" IMG_BASE: registry.nic.cz/labs/bird TOOLS_DIR: /var/lib/gitlab-runner/bird-tools + STAYRTR_BINARY: /var/lib/gitlab-runner/stayrtr-0.1-108-g8d18a41-linux-x86_64 stages: - image @@ -506,6 +507,7 @@ build-birdlab: - sudo git clean -fx - git pull --ff-only - mv $DIR/bird $DIR/birdc netlab/common + - ln -s $STAYRTR_BINARY netlab/common/stayrtr .test: &test-base stage: test @@ -516,7 +518,7 @@ build-birdlab: script: - cd $TOOLS_DIR/netlab - sudo ./stop - - sudo ./runtest -m check $TEST_NAME + - sudo ./runtest -s v3 -m check $TEST_NAME test-ospf-base: <<: *test-base @@ -588,6 +590,16 @@ test-bgp-merged: variables: TEST_NAME: cf-bgp-merged +test-bgp-flowspec: + <<: *test-base + variables: + TEST_NAME: cf-bgp-flowspec + +test-bgp-rs-multitab: + <<: *test-base + variables: + TEST_NAME: cf-bgp-rs-multitab + test-ebgp-loop: <<: *test-base variables: @@ -598,12 +610,32 @@ test-ebgp-star: variables: TEST_NAME: cf-ebgp-star +test-ebgp-role: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-role + +test-ebgp-graceful: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-graceful + +test-ebgp-import-limit: + <<: *test-base + variables: + TEST_NAME: cf-ebgp-import-limit + test-ibgp-loop: <<: *test-base variables: TEST_NAME: cf-ibgp-loop -test-ibgp-star: +test-ibgp-loop-big: + <<: *test-base + variables: + TEST_NAME: cf-ibgp-loop-big + +test-ibgp-flat: <<: *test-base variables: TEST_NAME: cf-ibgp-flat @@ -622,3 +654,8 @@ test-rip-base: <<: *test-base variables: TEST_NAME: cf-rip-base + +test-kernel-learn: + <<: *test-base + variables: + TEST_NAME: cf-kernel-learn diff --git a/conf/conf.c b/conf/conf.c index f27147e5..fc8e3c46 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -199,6 +199,23 @@ config_free(struct config *c) rfree(c->pool); } +/** + * config_free_old - free stored old configuration + * + * This function frees the old configuration (%old_config) that is saved for the + * purpose of undo. It is useful before parsing a new config when reconfig is + * requested, to avoid keeping three (perhaps memory-heavy) configs together. + */ +void +config_free_old(void) +{ + tm_stop(config_timer); + undo_available = 0; + + config_free(old_config); + old_config = NULL; +} + void config_add_obstacle(struct config *c) { diff --git a/conf/conf.h b/conf/conf.h index 9f011ef7..b30914c1 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -71,6 +71,7 @@ struct config *config_alloc(const char *name); int config_parse(struct config *); int cli_parse(struct config *); void config_free(struct config *); +void config_free_old(void); int config_commit(struct config *, int type, uint timeout); int config_confirm(void); int config_undo(void); diff --git a/configure.ac b/configure.ac index f942ec1b..2f37f9d0 100644 --- a/configure.ac +++ b/configure.ac @@ -226,6 +226,8 @@ else ;; openbsd*) sysdesc=bsd + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; dragonfly*) sysdesc=bsd diff --git a/doc/bird.sgml b/doc/bird.sgml index 37028a3b..badfe649 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1215,6 +1215,11 @@ This argument can be omitted if there exists only a single instance. restarted otherwise. Changes in filters usually lead to restart of affected protocols. + The previous configuration is saved and the user can switch back to it + with <ref id="cli-configure-undo" name="configure undo"> command. The + old saved configuration is released (even if the reconfiguration attempt + fails due to e.g. a syntax error). + If <cf/soft/ option is used, changes in filters does not cause BIRD to restart affected protocols, therefore already accepted routes (according to old filters) would be still propagated, but new routes would be diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 01cc0c93..b15376cc 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -245,6 +245,8 @@ async_config(void) { struct config *conf; + config_free_old(); + log(L_INFO "Reconfiguration requested by SIGHUP"); if (!unix_read_config(&conf, config_name)) { @@ -283,6 +285,9 @@ cmd_read_config(const char *name) void cmd_check_config(const char *name) { + if (cli_access_restricted()) + return; + struct config *conf = cmd_read_config(name); if (!conf) return; @@ -327,6 +332,8 @@ cmd_reconfig(const char *name, int type, uint timeout) if (cli_access_restricted()) return; + config_free_old(); + struct config *conf = cmd_read_config(name); if (!conf) return; |