From nobody Sat Jan 15 09:48:13 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E4BD5195695F; Sat, 15 Jan 2022 09:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JbYJF66vdz58GC; Sat, 15 Jan 2022 09:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642240093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVN53YcHxjIG15sJybLLtw+TXPDKxjcQHvYB+VbwOlM=; b=ldGKcKELFUZWoK5eODnQRL7GgjXNAAPI8HMW07j7YQ1RzeInJam1yjeYtHX0Cz3FkD55gV Ya/AabwWv6y9t4vKsHElq6fwCiGObyb8DrYKQ3Y+47HkfmaZHRiOukKNPyeuwgrTcYGDWm 8XJf/tjiOmkchjW2NDON2qts/4pq50HnFaNYKwLkypApFdfmimAqlKqAp4W1hX5kvQJP4+ RQi8Onlzj5sO6BJ1cO33MdszLGuc9LEFRxYGfFU+YJIaB9c931kaakzKfutvYVrIddL+UZ NZR2tEJHUw/cHq5C6r6irX54mDVdWo8OzNyObxDr+EViXNIvgULgiN2yBpXLJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9DD24D89; Sat, 15 Jan 2022 09:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20F9mDTo041134; Sat, 15 Jan 2022 09:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20F9mDGp041133; Sat, 15 Jan 2022 09:48:13 GMT (envelope-from git) Date: Sat, 15 Jan 2022 09:48:13 GMT Message-Id: <202201150948.20F9mDGp041133@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Eugene Grosbein Subject: git: f29fab6043ae - main - net/quagga: add three bugfixes from upstream List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f29fab6043ae4e3a2d448406a6c900c26f41c353 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642240093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVN53YcHxjIG15sJybLLtw+TXPDKxjcQHvYB+VbwOlM=; b=B/zxL9kRPJylYqL+wsRrc5iDhjVnl6i7Ml+RxDsG84YJS+t4o9fZv751WhkLeoxqrdUZF7 eZTxLhokKaynEX2RvhZ+8+epzalzPizdPbvHo1Xv+OeY26nYwrPptDNrSpy/IjicDUQHcF m6PDUGBDqNeoK9dJQGEXfpZuE8ik6Py5P8QwxBEHSzPHhHOGqoUlN/rfnrdkcioyg9dUZt Cb+Oc+uGKFwuwH4k7SjCtLPV7EhVFI8JAzYGTaQ8njUxIYLG+dwowLlvYzsG9VMtm7/fyw Kwzex+JYNnKI8PwlFXpG6xvGzIMYcltIeE+ZfIxp0xPrV+DJ1ZXMKoAKSM1dFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642240093; a=rsa-sha256; cv=none; b=tor4xCoWSEjzAj81yYJ21AQIG3ZNrGIZ+yAKBWs+GPzKlxECPuwg7Qw1bQ5+gRTbiFI73O DqzJsLxCIUim30CrR4LidmuEB8jGFFFIwCS1FePc7q+3eva4waMwDBLSbaNU/tJBeJegmJ TSlA5GPbW7Z2ptSfGbPCbKkPNZPSDpveeOGI6YKYgCzlt3bZ4HchheZH4bIOURx9BH7OIe jNhSzXg5duR0l6/L7fuGIxWFU+xUX3xCvW4Q9ro2zjWVKZBeisMJeBbDKzUMZxt6S8yTYU gJtleojIlDnmQv3EMi/iW3C3HTb+a721XbKA36UU6l3fvsDEWdjXIT3Z7ky22w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/ports/commit/?id=f29fab6043ae4e3a2d448406a6c900c26f41c353 commit f29fab6043ae4e3a2d448406a6c900c26f41c353 Author: Eugene Grosbein AuthorDate: 2022-01-15 09:42:20 +0000 Commit: Eugene Grosbein CommitDate: 2022-01-15 09:48:03 +0000 net/quagga: add three bugfixes from upstream This change imports three post-1.2.4 release changes from the primary Git repository of Quagga Project: 1) Fix threading error that broke ripd: https://gogs.quagga.net/Quagga/quagga/commit/1f918980c08d9fb9215609db39f7fb279c2e1807 2) Fix memory corruption that may occur when limit.rlim_cur is less then FD_SETSIZE: https://gogs.quagga.net/Quagga/quagga/commit/b54de751ef72fa67749825a0ea30af7c22d575c5 3) Prevent queue corruption when removing the last entry of queues https://gogs.quagga.net/Quagga/quagga/commit/e21719d8fa2b560d7cc9d1d9204bafee4984c577 PR: 261205 Approved by: pi (maintainer) --- net/quagga/Makefile | 2 +- net/quagga/files/patch-fdsetsize | 21 +++++++++++++++++++++ net/quagga/files/patch-lib_thread.c | 28 ++++++++++++++++++++++------ net/quagga/files/patch-pqueue.c | 14 ++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/net/quagga/Makefile b/net/quagga/Makefile index 5a4ca728e587..321a78832e7b 100644 --- a/net/quagga/Makefile +++ b/net/quagga/Makefile @@ -2,7 +2,7 @@ PORTNAME= quagga PORTVERSION= 1.2.4 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= net MASTER_SITES= https://github.com/Quagga/quagga/releases/download/${DISTNAME}/ diff --git a/net/quagga/files/patch-fdsetsize b/net/quagga/files/patch-fdsetsize new file mode 100644 index 000000000000..83067174f970 --- /dev/null +++ b/net/quagga/files/patch-fdsetsize @@ -0,0 +1,21 @@ +--- lib/thread.c.orig 2018-03-30 18:53:43.537794946 +0200 ++++ lib/thread.c 2018-03-30 19:17:27.919629268 +0200 +@@ -531,7 +531,8 @@ thread_master_create () + return NULL; + } + +- rv->fd_limit = (int)limit.rlim_cur; ++ rv->fd_limit = ((int)limit.rlim_cur < FD_SETSIZE ? ++ (int)limit.rlim_cur : FD_SETSIZE); + rv->read = XCALLOC (MTYPE_THREAD, sizeof (struct thread *) * rv->fd_limit); + if (rv->read == NULL) + { +@@ -1187,7 +1188,7 @@ thread_fetch (struct thread_master *m) + timer_wait = timer_wait_bg; + } + +- num = fd_select (FD_SETSIZE, &readfd, &writefd, &exceptfd, timer_wait); ++ num = fd_select (m->fd_limit, &readfd, &writefd, &exceptfd, timer_wait); + + /* Signals should get quick treatment */ + if (num < 0) diff --git a/net/quagga/files/patch-lib_thread.c b/net/quagga/files/patch-lib_thread.c index fdfe14662332..04736c624c00 100644 --- a/net/quagga/files/patch-lib_thread.c +++ b/net/quagga/files/patch-lib_thread.c @@ -1,11 +1,27 @@ ---- lib/thread.c.orig 2018-02-19 21:24:55 UTC -+++ lib/thread.c -@@ -603,6 +603,8 @@ thread_add_fd (struct thread **thread_ar +--- lib/thread.c.orig 2022-01-15 00:23:57.600963000 +0700 ++++ lib/thread.c 2022-01-15 00:26:01.645088000 +0700 +@@ -603,8 +603,12 @@ thread_add_fd (struct thread **thread_array, struct th static void thread_add_unuse (struct thread *thread) { -+ if (thread->type == THREAD_UNUSED) -+ return; ++ assert (thread); ++ /* thread_execute uses dummy threads, allocated on its stack */ ++ if (thread->master == NULL) ++ return; ++ thread->type = THREAD_UNUSED; - assert (thread->master != NULL && thread != NULL); +- assert (thread->master != NULL && thread != NULL); assert (thread->next == NULL); + assert (thread->prev == NULL); + thread_list_add (&thread->master->unuse, thread); +@@ -1342,9 +1346,7 @@ thread_call (struct thread *thread) + } + #endif /* CONSUMED_TIME_CHECK */ + +- +- if (thread->master) +- thread_add_unuse (thread); ++ thread_add_unuse (thread); + } + + /* Execute thread */ diff --git a/net/quagga/files/patch-pqueue.c b/net/quagga/files/patch-pqueue.c new file mode 100644 index 000000000000..c00e7f6efcaa --- /dev/null +++ b/net/quagga/files/patch-pqueue.c @@ -0,0 +1,14 @@ +--- lib/pqueue.c.orig 2018-02-20 04:24:55.000000000 +0700 ++++ lib/pqueue.c 2022-01-15 00:17:05.525677000 +0700 +@@ -172,7 +172,10 @@ pqueue_dequeue (struct pqueue *queue) + void + pqueue_remove_at (int index, struct pqueue *queue) + { +- queue->array[index] = queue->array[--queue->size]; ++ if (index == --queue->size) ++ return; /* we're removing the last entry */ ++ ++ queue->array[index] = queue->array[queue->size]; + + if (index > 0 + && (*queue->cmp) (queue->array[index],