From d9b77cc28115e5c1ef64c69722c9d1fd1392dcd1 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 24 Apr 2012 23:39:57 +0200 Subject: Implements generalized export limits. And also fixes some minor bugs in limits. --- proto/bgp/bgp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'proto/bgp') diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 95dbe477..3b9f7cc5 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -848,6 +848,8 @@ bgp_start(struct proto *P) return PS_START; } +extern int proto_restart; + static int bgp_shutdown(struct proto *P) { @@ -877,10 +879,16 @@ bgp_shutdown(struct proto *P) case PDC_IN_LIMIT_HIT: subcode = 1; // Errcode 6, 1 - max number of prefixes reached + /* log message for compatibility */ log(L_WARN "%s: Route limit exceeded, shutting down", p->p.name); + goto limit; + + case PDC_OUT_LIMIT_HIT: + subcode = proto_restart ? 4 : 2; // Administrative reset or shutdown + limit: bgp_store_error(p, NULL, BE_AUTO_DOWN, BEA_ROUTE_LIMIT_EXCEEDED); - if (P->cf->in_limit->action == PLA_RESTART) + if (proto_restart) bgp_update_startup_delay(p); else p->startup_delay = 0; -- cgit v1.2.3