Index | Thread | Search

From:
Kapetanakis Giannis <bilias@edu.physics.uoc.gr>
Subject:
bgpd stop logging when idle and depend on carp
To:
tech@openbsd.org
Date:
Sun, 2 Jun 2024 11:44:34 +0300

Download raw body.

Thread
  • Kapetanakis Giannis:

    bgpd stop logging when idle and depend on carp

I'm playing with bgpd.

After enabling depend on a carp interface, I'm getting messages every 2 
minutes on my backup router while everything seems fine. It's a bit spammy.

JunĀ  2 10:44:27 bgpd[67416]: Connection attempt from neighbor 
xx.xx.xx.xx (XXX) while session is in state Idle

Does the following makes sense in order to silence this?

Diff produced and tested on 7.5 release, but applies on current too.

G

Index: logmsg.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/logmsg.c,v
retrieving revision 1.11
diff -u -p -r1.11 logmsg.c
--- logmsg.c	16 Jan 2024 13:15:31 -0000	1.11
+++ logmsg.c	2 Jun 2024 08:32:46 -0000
@@ -219,7 +219,9 @@ log_conn_attempt(const struct peer *peer
  			    log_sockaddr(sa, len));
  	} else {
  		/* only log if there is a chance that the session may come up */
-		if (peer->conf.down && peer->state == STATE_IDLE)
+		if ((peer->conf.down && peer->state == STATE_IDLE) ||
+		    (!peer->conf.down && peer->state == STATE_IDLE &&
+		    peer->conf.if_depend[0]))
  			return;
  		p = log_fmt_peer(&peer->conf);
  		logit(LOG_INFO, "Connection attempt from %s while session is "