diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-06-04 13:31:09 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-06-04 13:31:09 +0200 |
commit | 72b28a041df18f0da2e6a85360d6935c6a2db471 (patch) | |
tree | bad02619dbb7181cb49dba4abcd9aa43c5fa39ab /proto/bgp/packets.c | |
parent | 925fe2d3de0e12c644f91f94d13bf388aeda9b57 (diff) |
Implements import route limits.
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r-- | proto/bgp/packets.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index d5397f5f..f358012a 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -725,13 +725,19 @@ bgp_do_rx_update(struct bgp_conn *conn, e->net = n; e->pflags = 0; rte_update(p->p.table, n, &p->p, &p->p, e); + if (bgp_apply_limits(p) < 0) + goto bad2; } + rta_free(a); } -bad: + + return; + + bad: + bgp_error(conn, 3, err, NULL, 0); + bad2: if (a) rta_free(a); - if (err) - bgp_error(conn, 3, err, NULL, 0); return; } @@ -825,6 +831,8 @@ bgp_do_rx_update(struct bgp_conn *conn, e->net = n; e->pflags = 0; rte_update(p->p.table, n, &p->p, &p->p, e); + if (bgp_apply_limits(p) < 0) + goto bad2; } rta_free(a); } @@ -832,8 +840,9 @@ bgp_do_rx_update(struct bgp_conn *conn, return; -bad: + bad: bgp_error(conn, 3, 9, start, len0); + bad2: if (a) rta_free(a); return; |