When rewriting community_writebuf() the handling of non-transitive
authorclaudio <claudio@openbsd.org>
Tue, 10 Oct 2023 14:36:28 +0000 (14:36 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 10 Oct 2023 14:36:28 +0000 (14:36 +0000)
commit578f8c8857308c1dca3745fe0bae04d8bd0556b8
treeafb82e17f447c1f927c9220ec71ea55930ca38a5
parentef065493fb463fe122ab7b535932b871830b6de3
When rewriting community_writebuf() the handling of non-transitive
ext-communities was put into the wrong place in the loop finding
start, end and number of communities to dump. As a result the end
pointer for regular communities can point at an ext-community and
with that the COMMUNITY attribute written includes unexpected extra
bytes. This in turn causes the peer to send a NOTIFICATION error
and to terminate the session.

Fix for -portable issue #64 reported by Pier Carlo Chiodi (pierky)
OK tb@
usr.sbin/bgpd/rde_community.c