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@
-/* $OpenBSD: rde_community.c,v 1.13 2023/07/12 14:45:43 claudio Exp $ */
+/* $OpenBSD: rde_community.c,v 1.14 2023/10/10 14:36:28 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
start = -1;
for (l = 0; l < comm->nentries; l++) {
cp = &comm->communities[l];
-
- if (ebgp && non_transitive_ext_community(cp))
- continue;
if ((uint8_t)cp->flags == t) {
+ if (ebgp && non_transitive_ext_community(cp))
+ continue;
num++;
if (start == -1)
start = l;