diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a758cff48a3ca8b64470929fdf293845084b79a..02d0a66a9ab203ed8521a7983d86a1f756022409 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 f27147e56b54be4bc7a6a0adb7629b0b05702152..fc8e3c4671bd248b31efeb196b3d56bb80671147 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 9f011ef737bc92d507c6989f5771fef91d395115..b30914c19517603e72abe6ba75ea8f4b0814f1ef 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 f942ec1bc502ca364de490758ab22c18891a6ff1..2f37f9d0e78fb7b7a30b3c39f4b58e3dfcd2a58f 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 37028a3b3509601baab355144778b125335e6dc4..badfe6499ea495323bca556c8d33045469cbf075 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 01cc0c93baf6aeba52d651eca2093488c5e8aeb1..b15376cc2094b3723f39eda2c32519b6ed47ecf8 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;