show the number of (currently) known prefixes and the max-prefix limit,
authorphessler <phessler@openbsd.org>
Fri, 19 Jun 2015 14:54:12 +0000 (14:54 +0000)
committerphessler <phessler@openbsd.org>
Fri, 19 Jun 2015 14:54:12 +0000 (14:54 +0000)
when we terminate the session.

since we terminate the session as soon as we go above the limit, show
'>' since there may be more that we haven't/won't process.

OK benno@

usr.sbin/bgpd/rde.c

index 8624461..fea40ae 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde.c,v 1.330 2015/03/14 03:52:42 claudio Exp $ */
+/*     $OpenBSD: rde.c,v 1.331 2015/06/19 14:54:12 phessler Exp $ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1124,7 +1124,8 @@ rde_update_dispatch(struct imsg *imsg)
                /* max prefix checker */
                if (peer->conf.max_prefix &&
                    peer->prefix_cnt >= peer->conf.max_prefix) {
-                       log_peer_warnx(&peer->conf, "prefix limit reached");
+                       log_peer_warnx(&peer->conf, "prefix limit reached"
+                           " (>%u/%u)", peer->prefix_cnt, peer->conf.max_prefix);
                        rde_update_err(peer, ERR_CEASE, ERR_CEASE_MAX_PREFIX,
                            NULL, 0);
                        goto done;
@@ -1206,7 +1207,9 @@ rde_update_dispatch(struct imsg *imsg)
                                if (peer->conf.max_prefix &&
                                    peer->prefix_cnt >= peer->conf.max_prefix) {
                                        log_peer_warnx(&peer->conf,
-                                           "prefix limit reached");
+                                           "prefix limit reached"
+                                           " (>%u/%u)", peer->prefix_cnt,
+                                           peer->conf.max_prefix);
                                        rde_update_err(peer, ERR_CEASE,
                                            ERR_CEASE_MAX_PREFIX, NULL, 0);
                                        goto done;
@@ -1242,7 +1245,9 @@ rde_update_dispatch(struct imsg *imsg)
                                if (peer->conf.max_prefix &&
                                    peer->prefix_cnt >= peer->conf.max_prefix) {
                                        log_peer_warnx(&peer->conf,
-                                           "prefix limit reached");
+                                           "prefix limit reached"
+                                           " (>%u/%u)", peer->prefix_cnt,
+                                           peer->conf.max_prefix);
                                        rde_update_err(peer, ERR_CEASE,
                                            ERR_CEASE_MAX_PREFIX, NULL, 0);
                                        goto done;