From: claudio Date: Thu, 27 May 2021 08:20:39 +0000 (+0000) Subject: Fix bad logic in last commit. If graceful restart is on and the forwarding X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=50195527c51bf5e8bc99f4772afcce410bf7fd59;p=openbsd Fix bad logic in last commit. If graceful restart is on and the forwarding state is preserved do the graceful restart dance. If graceful restart is off or the forwarding state was not preserved flush the table. --- diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 455efa7617a..9cfefc05bf3 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.416 2021/05/27 07:52:54 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.417 2021/05/27 08:20:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -2571,7 +2571,7 @@ capa_neg_calc(struct peer *p) negflags = p->capa.neg.grestart.flags[i]; p->capa.neg.grestart.flags[i] = p->capa.peer.grestart.flags[i]; if (negflags & CAPA_GR_RESTARTING) { - if (p->capa.ann.grestart.restart != 0 || + if (p->capa.ann.grestart.restart != 0 && p->capa.peer.grestart.flags[i] & CAPA_GR_FORWARD) { p->capa.neg.grestart.flags[i] |= CAPA_GR_RESTARTING;