From 9d5960cfa5b4c15ddd48dbab599f864a6aa1e025 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 10 Jun 2014 12:16:01 +0200 Subject: [PATCH 01/15] Fixes max include depth in documentation. Thanks to Artyom Gavrichenkov for the patch. --- doc/bird.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index fa4c777f..beacd4be 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -318,7 +318,7 @@ protocol rip {

include " This statement causes inclusion of a new file. + This option specifies the Default Router Preference value to advertise + to hosts. Default: medium. + rdnss local Use only local (interface-specific) RDNSS definitions for this interface. Otherwise, both global and local definitions are used. Could diff --git a/proto/radv/config.Y b/proto/radv/config.Y index 88a9e298..a26ea88e 100644 --- a/proto/radv/config.Y +++ b/proto/radv/config.Y @@ -30,9 +30,9 @@ CF_KEYWORDS(RADV, PREFIX, INTERFACE, MIN, MAX, RA, DELAY, INTERVAL, MANAGED, OTHER, CONFIG, LINK, MTU, REACHABLE, TIME, RETRANS, TIMER, CURRENT, HOP, LIMIT, DEFAULT, VALID, PREFERRED, MULT, LIFETIME, SKIP, ONLINK, AUTONOMOUS, RDNSS, DNSSL, NS, DOMAIN, - LOCAL, TRIGGER, SENSITIVE) + LOCAL, TRIGGER, SENSITIVE, PREFERENCE, LOW, MEDIUM, HIGH) -%type radv_mult radv_sensitive +%type radv_mult radv_sensitive radv_preference CF_GRAMMAR @@ -84,6 +84,7 @@ radv_iface_start: RADV_IFACE->current_hop_limit = DEFAULT_CURRENT_HOP_LIMIT; RADV_IFACE->default_lifetime = -1; RADV_IFACE->default_lifetime_sensitive = 1; + RADV_IFACE->default_preference = RA_PREF_MEDIUM; }; radv_iface_item: @@ -101,6 +102,7 @@ radv_iface_item: if (($3 < 0) || ($3 > 9000)) cf_error("Default lifetime must be in range 0-9000"); if ($4 != -1) RADV_IFACE->default_lifetime_sensitive = $4; } + | DEFAULT PREFERENCE radv_preference { RADV_IFACE->default_preference = $3; } | PREFIX radv_prefix { add_tail(&RADV_IFACE->pref_list, NODE this_radv_prefix); } | RDNSS { init_list(&radv_dns_list); } radv_rdnss { add_tail_list(&RADV_IFACE->rdnss_list, &radv_dns_list); } | DNSSL { init_list(&radv_dns_list); } radv_dnssl { add_tail_list(&RADV_IFACE->dnssl_list, &radv_dns_list); } @@ -108,6 +110,11 @@ radv_iface_item: | DNSSL LOCAL bool { RADV_IFACE->dnssl_local = $3; } ; +radv_preference: + LOW { $$ = RA_PREF_LOW; } + | MEDIUM { $$ = RA_PREF_MEDIUM; } + | HIGH { $$ = RA_PREF_HIGH; } + radv_iface_finish: { struct radv_iface_config *ic = RADV_IFACE; diff --git a/proto/radv/packets.c b/proto/radv/packets.c index 1d7e04f4..ef869722 100644 --- a/proto/radv/packets.c +++ b/proto/radv/packets.c @@ -251,10 +251,11 @@ radv_prepare_ra(struct radv_iface *ifa) pkt->code = 0; pkt->checksum = 0; pkt->current_hop_limit = ic->current_hop_limit; - pkt->flags = (ic->managed ? OPT_RA_MANAGED : 0) | - (ic->other_config ? OPT_RA_OTHER_CFG : 0); pkt->router_lifetime = (ra->active || !ic->default_lifetime_sensitive) ? htons(ic->default_lifetime) : 0; + pkt->flags = (ic->managed ? OPT_RA_MANAGED : 0) | + (ic->other_config ? OPT_RA_OTHER_CFG : 0) | + (pkt->router_lifetime ? ic->default_preference : 0); pkt->reachable_time = htonl(ic->reachable_time); pkt->retrans_timer = htonl(ic->retrans_timer); buf += sizeof(*pkt); @@ -330,10 +331,15 @@ radv_send_ra(struct radv_iface *ifa, int shutdown) if (shutdown) { - /* Modify router lifetime to 0, it is not restored because - we suppose that the iface will be removed */ + /* + * Modify router lifetime to 0, it is not restored because we suppose that + * the iface will be removed. The preference value also has to be zeroed. + * (RFC 4191 2.2: If router lifetime is 0, the preference value must be 0.) + */ + struct radv_ra_packet *pkt = (void *) ifa->sk->tbuf; pkt->router_lifetime = 0; + pkt->flags &= ~RA_PREF_MASK; } RADV_TRACE(D_PACKETS, "Sending RA via %s", ifa->iface->name); diff --git a/proto/radv/radv.c b/proto/radv/radv.c index 90408536..6be7cd84 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -40,6 +40,7 @@ * Supported standards: * - RFC 4861 - main RA standard * - RFC 6106 - DNS extensions (RDDNS, DNSSL) + * - RFC 4191 (partial) - Default Router Preference */ static void diff --git a/proto/radv/radv.h b/proto/radv/radv.h index f80e4530..bb80d65f 100644 --- a/proto/radv/radv.h +++ b/proto/radv/radv.h @@ -80,6 +80,7 @@ struct radv_iface_config u32 current_hop_limit; u32 default_lifetime; u8 default_lifetime_sensitive; /* Whether default_lifetime depends on trigger */ + u8 default_preference; /* Default Router Preference (RFC 4191) */ }; struct radv_prefix_config @@ -144,6 +145,11 @@ struct radv_iface #define RA_EV_CHANGE 2 /* Change of options or prefixes */ #define RA_EV_RS 3 /* Received RS */ +/* Default Router Preferences (RFC 4191) */ +#define RA_PREF_LOW 0x18 +#define RA_PREF_MEDIUM 0x00 +#define RA_PREF_HIGH 0x08 +#define RA_PREF_MASK 0x18 #ifdef LOCAL_DEBUG From 029ec22d0acedb79e03394b60ea99bb46c479d79 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 9 Jul 2014 18:34:42 +0200 Subject: [PATCH 06/15] Fixes a bug in BSD kernel interfacing code. The bug was introduced in 05476c4d04a24bdb26fa64e05ab31bc36118f34e. --- sysdep/bsd/krt-sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index 26710375..621f7309 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -261,6 +261,7 @@ krt_send_route(struct krt_proto *p, int cmd, rte *e) msg.rtm.rtm_flags |= RTF_GATEWAY; msg.rtm.rtm_addrs |= RTA_GATEWAY; break; + #ifdef RTF_REJECT case RTD_UNREACHABLE: #endif @@ -280,7 +281,7 @@ krt_send_route(struct krt_proto *p, int cmd, rte *e) return -1; } - sockaddr_fill(&dst, BIRD_AF, i->addr->ip, NULL, 0); + sockaddr_fill(&gate, BIRD_AF, i->addr->ip, NULL, 0); msg.rtm.rtm_addrs |= RTA_GATEWAY; } break; From 06c4b6ac9da204453049fa56a204474486a9c9e9 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 9 Jul 2014 18:42:59 +0200 Subject: [PATCH 07/15] NEWS and version update. --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 4fe259aa..edbaa80d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +Version 1.4.4 (2014-07-09) + o Extended OSPF multipath support. + o Default router preference for RAdv. + o Significant changes in socket layer. + o Important bugfix in BGP. + o Several minor bugfixes. + Version 1.4.3 (2014-04-14) o Important bugfix in IPv6 BGP. From 7c00551749005ad951845eb924f76e1fd28e62a2 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Wed, 9 Jul 2014 23:46:02 +0200 Subject: [PATCH 08/15] Version 1.4.4. --- sysdep/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdep/config.h b/sysdep/config.h index e2ea7642..0f48f06a 100644 --- a/sysdep/config.h +++ b/sysdep/config.h @@ -7,7 +7,7 @@ #define _BIRD_CONFIG_H_ /* BIRD version */ -#define BIRD_VERSION "1.4.3" +#define BIRD_VERSION "1.4.4" /* Include parameters determined by configure script */ #include "sysdep/autoconf.h" From 0479b44373892db273f3e0365c7cbaad2eeb0d5f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 2 Oct 2014 10:59:34 +0200 Subject: [PATCH 09/15] Fixes some warnings. --- nest/rt-attr.c | 2 +- proto/bfd/bfd.c | 4 ++-- sysdep/unix/io.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 97a1bc27..09691bf1 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -815,7 +815,7 @@ rta_alloc_hash(void) static inline unsigned int rta_hash(rta *a) { - return (((unsigned) a->src) ^ ipa_hash(a->gw) ^ + return (((uint) (uintptr_t) a->src) ^ ipa_hash(a->gw) ^ mpnh_hash(a->nexthops) ^ ea_hash(a->eattrs)) & 0xffff; } diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c index 7bbe8c21..23e04e40 100644 --- a/proto/bfd/bfd.c +++ b/proto/bfd/bfd.c @@ -1062,7 +1062,7 @@ bfd_copy_config(struct proto_config *dest, struct proto_config *src) // struct bfd_config *s = (struct bfd_config *) src; /* We clean up patt_list and neigh_list, neighbors and ifaces are non-sharable */ - init_list(&d->patt_list); + init_list(&d->patt_list); init_list(&d->neigh_list); } @@ -1071,7 +1071,7 @@ bfd_show_sessions(struct proto *P) { byte tbuf[TM_DATETIME_BUFFER_SIZE]; struct bfd_proto *p = (struct bfd_proto *) P; - uint state, diag; + uint state, diag UNUSED; u32 tx_int, timeout; const char *ifname; diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index a5477695..164038ec 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1967,7 +1967,7 @@ io_loop(void) while (current_sock && count < MAX_RX_STEPS) { sock *s = current_sock; - int e; + int e UNUSED; if ((s->type < SK_MAGIC) && FD_ISSET(s->fd, &rd) && s->rx_hook) { From b2f008378a39104152b20a969942cd6c99644984 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 2 Oct 2014 11:02:14 +0200 Subject: [PATCH 10/15] Allows more constants in set literals. Thanks to Michael Fincham for the bugreport. --- conf/cf-lex.l | 2 +- conf/conf.h | 4 ++++ filter/config.Y | 28 +++++++++++++++++++++++++++- filter/test.conf | 9 ++++++--- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 99785057..35b590bb 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -646,7 +646,7 @@ cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos) char * cf_symbol_class_name(struct symbol *sym) { - if ((sym->class & 0xff00) == SYM_CONSTANT) + if (cf_symbol_is_constant(sym)) return "constant"; switch (sym->class) diff --git a/conf/conf.h b/conf/conf.h index fa14d7b5..799873d2 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -149,6 +149,10 @@ void cf_pop_scope(void); struct symbol *cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos); char *cf_symbol_class_name(struct symbol *sym); +static inline int cf_symbol_is_constant(struct symbol *sym) +{ return (sym->class & 0xff00) == SYM_CONSTANT; } + + /* Parser */ int cf_parse(void); diff --git a/filter/config.Y b/filter/config.Y index 04acfbab..e50e75ca 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -25,6 +25,23 @@ static inline u32 pair_b(u32 p) { return p & 0xFFFF; } * to the last item in a list (right ptr). For convenience, even items * are handled as one-item lists. Lists are merged by f_merge_items(). */ +static int +f_valid_set_type(int type) +{ + switch (type) + { + case T_INT: + case T_PAIR: + case T_QUAD: + case T_ENUM: + case T_IP: + case T_EC: + return 1; + + default: + return 0; + } +} static inline struct f_tree * f_new_item(struct f_val from, struct f_val to) @@ -473,10 +490,19 @@ fipa: */ set_atom: - expr { $$.type = T_INT; $$.val.i = $1; } + NUM { $$.type = T_INT; $$.val.i = $1; } | RTRID { $$.type = T_QUAD; $$.val.i = $1; } | fipa { $$ = $1; } | ENUM { $$.type = pair_a($1); $$.val.i = pair_b($1); } + | '(' term ')' { + $$ = f_eval($2, cfg_mem); + if (!f_valid_set_type($$.type)) cf_error("Set-incompatible type"); + } + | SYM { + if (!cf_symbol_is_constant($1)) cf_error("%s: constant expected", $1->name); + if (!f_valid_set_type(SYM_TYPE($1))) cf_error("%s: set-incompatible type", $1->name); + $$ = *(struct f_val *)($1->def); + } ; switch_atom: diff --git a/filter/test.conf b/filter/test.conf index 84faca0e..a99d0a51 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -13,6 +13,9 @@ define '1a-a1' = (20+10); define one = 1; define ten = 10; +define p23 = (2, 3); +define ip1222 = 1.2.2.2; + function onef(int a) { return 1; @@ -98,7 +101,7 @@ eclist el2; print "Should be true: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 3 ~ p2, " ", p2 ~ [2, 10..20], " ", p2 ~ [4, 10..20]; print "4 = ", p2.len; p2 = prepend( p2, 5 ); - print "Should be false: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 10 ~ p2, " ", p2 ~ [8, 10..20],; + print "Should be false: ", p2 ~ pm1, " ", p2 ~ pm2, " ", 10 ~ p2, " ", p2 ~ [8, ten..(2*ten)]; print "Should be true: ", p2 ~ / ? 4 3 2 1 /, " ", p2, " ", / ? 4 3 2 1 /; print "Should be true: ", p2 ~ [= * 4 3 * 1 =], " ", p2, " ", [= * 4 3 * 1 =]; print "Should be true: ", p2 ~ [= (3+2) (2*2) 3 2 1 =], " ", p2 ~ mkpath(5, 4); @@ -124,7 +127,7 @@ eclist el2; print "Should be always true: ", l ~ [(*,*)]; l = add( l, (2,one+2) ); print "Community list (1,2) (2,3) ", l; - print "Should be true: ", (2,3) ~ l, " ", l ~ [(1,*)], " ", l ~ [(2,3)]," ", l ~ [(2,2..3)], " ", l ~ [(1,1..2)], " ", l ~ [(1,1)..(1,2)]; + print "Should be true: ", (2,3) ~ l, " ", l ~ [(1,*)], " ", l ~ [p23]," ", l ~ [(2,2..3)], " ", l ~ [(1,1..2)], " ", l ~ [(1,1)..(1,2)]; l = add( l, (2,5) ); l = add( l, (5,one) ); l = add( l, (6,one) ); @@ -361,7 +364,7 @@ string st; if ( b = true ) then print "Testing bool comparison b = true: ", b; else { print "*** FAIL: TRUE test failed" ; quitbird; } - ips = [ 1.1.1.0 .. 1.1.1.255, 1.2.2.2]; + ips = [ 1.1.1.0 .. 1.1.1.255, ip1222]; print "Testing IP sets: "; print ips; print " must be true: ", 1.1.1.0 ~ ips, ",", 1.1.1.100 ~ ips, ",", 1.2.2.2 ~ ips; From 252c7e4d0b7b45c89f69b3c4763b0c013aa5830d Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 2 Oct 2014 11:05:55 +0200 Subject: [PATCH 11/15] Refresh kernel protocol when interface disappears. When an interface goes down, (Linux) kernel removes routes pointing to that ifacem but does not send withdraws for them. We rescan the kernel table to ensure synchronization. Thanks to Alexander Demenshin for the bugreport. --- sysdep/unix/krt.c | 50 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index bff3001f..51950ec9 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -36,7 +36,7 @@ * only once for all the instances. * * The code uses OS-dependent parts for kernel updates and scans. These parts are - * in more specific sysdep directories (e.g. sysdep/linux) in functions krt_sys_* + * in more specific sysdep directories (e.g. sysdep/linux) in functions krt_sys_* * and kif_sys_* (and some others like krt_replace_rte()) and krt-sys.h header file. * This is also used for platform specific protocol options and route attributes. * @@ -117,7 +117,7 @@ kif_request_scan(void) static inline int prefer_addr(struct ifa *a, struct ifa *b) -{ +{ int sa = a->scope > SCOPE_LINK; int sb = b->scope > SCOPE_LINK; @@ -737,7 +737,7 @@ krt_prune(struct krt_proto *p) if (! krt_export_rte(p, &new, &tmpa)) { /* Route rejected, should not happen (KRF_INSTALLED) but to be sure .. */ - verdict = (verdict == KRF_CREATE) ? KRF_IGNORE : KRF_DELETE; + verdict = (verdict == KRF_CREATE) ? KRF_IGNORE : KRF_DELETE; } else { @@ -910,7 +910,7 @@ krt_scan_timer_stop(struct krt_proto *p) } static void -krt_scan_timer_kick(struct krt_proto *p UNUSED) +krt_scan_timer_kick(struct krt_proto *p) { tm_start(p->scan_timer, 0); } @@ -962,8 +962,8 @@ krt_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool * if (e->attrs->src->proto == P) return -1; - if (!KRT_CF->devroutes && - (e->attrs->dest == RTD_DEVICE) && + if (!KRT_CF->devroutes && + (e->attrs->dest == RTD_DEVICE) && (e->attrs->source != RTS_STATIC_DEVICE)) return -1; @@ -974,8 +974,8 @@ krt_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool * } static void -krt_notify(struct proto *P, struct rtable *table UNUSED, net *net, - rte *new, rte *old, struct ea_list *eattrs) +krt_rt_notify(struct proto *P, struct rtable *table UNUSED, net *net, + rte *new, rte *old, struct ea_list *eattrs) { struct krt_proto *p = (struct krt_proto *) P; @@ -991,6 +991,36 @@ krt_notify(struct proto *P, struct rtable *table UNUSED, net *net, krt_replace_rte(p, net, new, old, eattrs); } +static void +krt_if_notify(struct proto *P, uint flags, struct iface *iface UNUSED) +{ + struct krt_proto *p = (struct krt_proto *) P; + + /* + * When interface went down, we should remove routes to it. In the ideal world, + * OS kernel would send us route removal notifications in such cases, but we + * cannot rely on it as it is often not true. E.g. Linux kernel removes related + * routes when an interface went down, but it does not notify userspace about + * that. To be sure, we just schedule a scan to ensure synchronization. + */ + + if ((flags & IF_CHANGE_DOWN) && KRT_CF->learn) + krt_scan_timer_kick(p); +} + +static int +krt_reload_routes(struct proto *P) +{ + struct krt_proto *p = (struct krt_proto *) P; + + /* Although we keep learned routes in krt_table, we rather schedule a scan */ + + if (KRT_CF->learn) + krt_scan_timer_kick(p); + + return 1; +} + static void krt_feed_done(struct proto *P) { @@ -1022,7 +1052,9 @@ krt_init(struct proto_config *c) p->p.accept_ra_types = RA_OPTIMAL; p->p.import_control = krt_import_control; - p->p.rt_notify = krt_notify; + p->p.rt_notify = krt_rt_notify; + p->p.if_notify = krt_if_notify; + p->p.reload_routes = krt_reload_routes; p->p.feed_done = krt_feed_done; p->p.make_tmp_attrs = krt_make_tmp_attrs; p->p.store_tmp_attrs = krt_store_tmp_attrs; From dcde7ae597ccb7d81648b9ecab7c0f61c88e60f2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 2 Oct 2014 11:33:55 +0200 Subject: [PATCH 12/15] Allows to configure different remote port for BGP sessions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to João Taveira Araújo for the original patch. --- conf/confbase.Y | 12 ++++++++++-- doc/bird.sgml | 5 ++--- proto/bgp/bgp.c | 4 ++-- proto/bgp/bgp.h | 1 + proto/bgp/config.Y | 5 +++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/conf/confbase.Y b/conf/confbase.Y index cba6fc56..49831b1a 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -72,7 +72,7 @@ CF_DECLS %token TEXT %type ipa_scope -%type expr bool pxlen +%type expr bool pxlen ipa_port %type expr_us %type

] [protocol

] [stats|count]]], [[Show routing table]]) +CF_CLI(SHOW ROUTE, r_args, [[[|for |for ] [table ] [filter |where ] [all] [primary] [filtered] [(export|preexport|noexport)

] [protocol

] [stats|count]]], [[Show routing table]]) { rt_show($3); } ; r_args: @@ -492,7 +492,7 @@ r_args: $$ = $1; $$->filtered = 1; } - | r_args export_or_preexport SYM { + | r_args export_mode SYM { struct proto_config *c = (struct proto_config *) $3->def; $$ = $1; if ($$->export_mode) cf_error("Protocol specified twice"); @@ -519,9 +519,10 @@ r_args: } ; -export_or_preexport: - PREEXPORT { $$ = 1; } - | EXPORT { $$ = 2; } +export_mode: + PREEXPORT { $$ = RSEM_PREEXPORT; } + | EXPORT { $$ = RSEM_EXPORT; } + | NOEXPORT { $$ = RSEM_NOEXPORT; } ; diff --git a/nest/route.h b/nest/route.h index 82d9e202..5ee04a30 100644 --- a/nest/route.h +++ b/nest/route.h @@ -301,6 +301,12 @@ struct rt_show_data { }; void rt_show(struct rt_show_data *); +/* Value of export_mode in struct rt_show_data */ +#define RSEM_NONE 0 /* Export mode not used */ +#define RSEM_PREEXPORT 1 /* Routes ready for export, before filtering */ +#define RSEM_EXPORT 2 /* Routes accepted by export filter */ +#define RSEM_NOEXPORT 3 /* Routes rejected by export filter */ + /* * Route Attributes * diff --git a/nest/rt-table.c b/nest/rt-table.c index 37dbb33d..59fd0711 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2255,6 +2255,9 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) if (d->export_mode) { + if (! d->export_protocol->rt_notify) + return; + a = proto_find_announce_hook(d->export_protocol, d->table); if (!a) return; @@ -2287,18 +2290,20 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) if (ic < 0) goto skip; - if (d->export_mode > 1) + if (d->export_mode > RSEM_PREEXPORT) { /* * FIXME - This shows what should be exported according to current * filters, but not what was really exported. 'configure soft' * command may change the export filter and do not update routes. */ + int do_export = (ic > 0) || + (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) <= F_ACCEPT); - if (!ic && (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)) + if (do_export != (d->export_mode == RSEM_EXPORT)) goto skip; - if (ep->accept_ra_types == RA_ACCEPTED) + if ((d->export_mode == RSEM_EXPORT) && (ep->accept_ra_types == RA_ACCEPTED)) pass = 1; } } From cfdea7b85f6c520cc5a62eb907d2190db14c9900 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 5 Oct 2014 23:59:18 +0200 Subject: [PATCH 15/15] NEWS and version update. --- NEWS | 9 ++++++++- misc/bird.spec | 2 +- sysdep/config.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index edbaa80d..cd3e2b81 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +Version 1.4.5 (2014-10-06) + o New 'show route noexport' command option. + o Port option for BGP sessions. + o Better constant handling in set literals. + o Better rate filtering of log messages. + o Several minor bugfixes. + Version 1.4.4 (2014-07-09) o Extended OSPF multipath support. o Default router preference for RAdv. @@ -39,7 +46,7 @@ Version 1.4.0 (2013-11-25) - Import of device routes from kernel protocol allowed. - Last state change now tracks just protocol state change. - Minor changes to default router ID calculation. - + Version 1.3.11 (2013-07-27) o OSPF stub router option (RFC 3137). o TTL security for OSPF and RIP. diff --git a/misc/bird.spec b/misc/bird.spec index 0c730982..30601a91 100644 --- a/misc/bird.spec +++ b/misc/bird.spec @@ -1,6 +1,6 @@ Summary: BIRD Internet Routing Daemon Name: bird -Version: 1.4.3 +Version: 1.4.5 Release: 1 Copyright: GPL Group: Networking/Daemons diff --git a/sysdep/config.h b/sysdep/config.h index 0f48f06a..02f62762 100644 --- a/sysdep/config.h +++ b/sysdep/config.h @@ -7,7 +7,7 @@ #define _BIRD_CONFIG_H_ /* BIRD version */ -#define BIRD_VERSION "1.4.4" +#define BIRD_VERSION "1.4.5" /* Include parameters determined by configure script */ #include "sysdep/autoconf.h"