From c6a2fe64bed8dc67af0e868052b055aa0f45cdf2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sat, 9 Feb 2013 00:53:04 +0100 Subject: [PATCH 1/5] Fixes handling of iface routes in static proto during reconfiguration. During reconfiguration, iface routes were installed even when iface was down. --- proto/static/static.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/static/static.c b/proto/static/static.c index 6a027f50..9eee820d 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -461,7 +461,7 @@ static_reconfigure(struct proto *p, struct proto_config *new) WALK_LIST(r, n->iface_routes) { struct iface *ifa; - if (ifa = if_find_by_name(r->if_name)) + if ((ifa = if_find_by_name(r->if_name)) && (ifa->flags & IF_UP)) static_install(p, r, ifa); } WALK_LIST(r, n->other_routes) From 155134f3960bc06a18c8c7d9a97181b786d77a3a Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Sun, 10 Feb 2013 19:04:08 +0100 Subject: [PATCH 2/5] A few semicolons added to decrease a number of warnings. --- proto/ospf/config.Y | 2 +- proto/radv/config.Y | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index a617292e..3f09afba 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -440,7 +440,7 @@ lsadb_args: $$ = cfg_allocz(sizeof(struct lsadb_show_data)); } | lsadb_args GLOBAL { $$ = $1; $$->scope = LSA_SCOPE_AS; } - | lsadb_args AREA idval { $$ = $1; $$->scope = LSA_SCOPE_AREA; $$->area = $3 } + | lsadb_args AREA idval { $$ = $1; $$->scope = LSA_SCOPE_AREA; $$->area = $3; } | lsadb_args LINK { $$ = $1; $$->scope = 1; /* hack, 0 is no filter */ } | lsadb_args TYPE NUM { $$ = $1; $$->type = $3; } | lsadb_args LSID idval { $$ = $1; $$->lsid = $3; } diff --git a/proto/radv/config.Y b/proto/radv/config.Y index fbec5a0a..c5b7aaee 100644 --- a/proto/radv/config.Y +++ b/proto/radv/config.Y @@ -290,8 +290,8 @@ radv_mult: ; radv_sensitive: - /* empty */ { $$ = -1 } - | SENSITIVE bool { $$ = $2 } + /* empty */ { $$ = -1; } + | SENSITIVE bool { $$ = $2; } ; CF_CODE From 0bc3542ab6e0a96342e35ead8ff1c52f980facc2 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Sun, 10 Feb 2013 19:06:56 +0100 Subject: [PATCH 3/5] Route limits can be disabled - this makes sense for protocol templates --- doc/bird.sgml | 12 ++++++------ nest/config.Y | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 762834e3..1baa1528 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -478,7 +478,7 @@ to zero to disable it. An empty is equivalent to import limit + import limit [ Specify an import route limit (a maximum number of routes imported from the protocol) and optionally the action to be taken when the limit is hit. Warn action just prints warning @@ -486,9 +486,9 @@ to zero to disable it. An empty is equivalent to receive limit + receive limit [ Specify an receive route limit (a maximum number of routes received from the protocol and remembered). It works almost identically to import limit option, the only @@ -498,9 +498,9 @@ to zero to disable it. An empty is equivalent to export limit + export limit [ Specify an export route limit, works similarly to the import limit option, but for the routes exported to the protocol. This option is experimental, there are some @@ -509,7 +509,7 @@ to zero to disable it. An empty is equivalent to description " This is an optional description of the protocol. It is displayed as a part of the diff --git a/nest/config.Y b/nest/config.Y index e46b5fb5..75728e0d 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -216,6 +216,7 @@ limit_spec: l->action = $2; $$ = l; } + | OFF { $$ = 0; } ; rtable: From 8c4da7e01ded3f06cbf873e67c5ae1cf70cf280b Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Sun, 10 Feb 2013 19:17:38 +0100 Subject: [PATCH 4/5] Symbol names enclosed by apostrophes can contain DOTs. --- conf/cf-lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cf-lex.l b/conf/cf-lex.l index c8eae0e8..e0430485 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -172,7 +172,7 @@ else: { return ELSECOL; } -({ALPHA}{ALNUM}*|[']({ALNUM}|[-])*[']) { +({ALPHA}{ALNUM}*|[']({ALNUM}|[-]|[\.])*[']) { if(*yytext == '\'') { yytext[yyleng-1] = 0; yytext++; From 4c2abee74e64f64fba61aad6e2b66e3895820003 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 12 Feb 2013 13:15:01 +0100 Subject: [PATCH 5/5] Allow submitting BIRD commands from UNIX shell even in restricted mode. --- client/client.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/client.c b/client/client.c index 8711cf0a..d8f0060c 100644 --- a/client/client.c +++ b/client/client.c @@ -29,6 +29,7 @@ static char *opt_list = "s:vr"; static int verbose; static char *init_cmd; static int once; +static int restricted; static char *server_path = PATH_CONTROL_SOCKET; static int server_fd; @@ -70,7 +71,7 @@ parse_args(int argc, char **argv) verbose++; break; case 'r': - init_cmd = "restrict"; + restricted = 1; break; default: usage(); @@ -83,9 +84,6 @@ parse_args(int argc, char **argv) int i; int len = 0; - if (init_cmd) - usage(); - for (i = optind; i < argc; i++) len += strlen(argv[i]) + 1; @@ -303,6 +301,13 @@ update_state(void) if (nstate == cstate) return; + if (restricted) + { + submit_server_command("restrict"); + restricted = 0; + return; + } + if (init_cmd) { /* First transition - client received hello from BIRD