summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2005-06-04 22:54:22 +0000
committerhenning <henning@openbsd.org>2005-06-04 22:54:22 +0000
commit2234b13bb60b4e7300ca62c5ea0b72f9e73cc3ff (patch)
treeb01ac1cc38a0dfa73e3218695ab6b4e18bfeecfc
parentwhen sending out a notification record the error code and suberror code in (diff)
downloadwireguard-openbsd-2234b13bb60b4e7300ca62c5ea0b72f9e73cc3ff.tar.xz
wireguard-openbsd-2234b13bb60b4e7300ca62c5ea0b72f9e73cc3ff.zip
use the recorded error code to prevent sending out multiple notifications
-rw-r--r--usr.sbin/bgpd/session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 88016b21896..3c461341842 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.222 2005/06/04 22:50:20 henning Exp $ */
+/* $OpenBSD: session.c,v 1.223 2005/06/04 22:54:22 henning Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -1367,6 +1367,9 @@ session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode,
ssize_t len;
int errs = 0;
+ if (peer->stats.last_sent_errcode) /* some notifctn already sent */
+ return;
+
len = MSGSIZE_NOTIFICATION_MIN + datalen;
memset(&msg.marker, 0xff, sizeof(msg.marker));