Wed Dec 1 19:18:57 2021 UTC ()
Apply upstream's patch to <https://github.com/lldpd/lldpd/issues/489>
"bridge0 is a bridge too big. Please, report the problem"


(hauke)
diff -r1.37 -r1.38 pkgsrc/net/lldpd/Makefile
diff -r1.18 -r1.19 pkgsrc/net/lldpd/distinfo
diff -r0 -r1.3 pkgsrc/net/lldpd/patches/patch-src_daemon_interfaces-bsd.c

cvs diff -r1.37 -r1.38 pkgsrc/net/lldpd/Makefile (expand / switch to context diff)
--- pkgsrc/net/lldpd/Makefile 2021/11/30 11:26:33 1.37
+++ pkgsrc/net/lldpd/Makefile 2021/12/01 19:18:56 1.38
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.37 2021/11/30 11:26:33 hauke Exp $
+# $NetBSD: Makefile,v 1.38 2021/12/01 19:18:56 hauke Exp $
 
 DISTNAME=		lldpd-1.0.13
+PKGREVISION=		1
 CATEGORIES=		net
 MASTER_SITES=		http://media.luffy.cx/files/lldpd/
 
@@ -57,6 +58,9 @@
 INSTALLATION_DIRS+=	${EGDIR} share/doc
 INSTALLATION_DIRS+=	share/bash-completion/completions
 INSTALLATION_DIRS+=	share/zsh/site-functions
+
+# Ownership and permission conflict with useradd?
+#OWN_DIRS+=		${LLDPD_HOME}
 
 TEST_TARGET=		check
 

cvs diff -r1.18 -r1.19 pkgsrc/net/lldpd/distinfo (expand / switch to context diff)
--- pkgsrc/net/lldpd/distinfo 2021/11/30 11:26:33 1.18
+++ pkgsrc/net/lldpd/distinfo 2021/12/01 19:18:56 1.19
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.18 2021/11/30 11:26:33 hauke Exp $
+$NetBSD: distinfo,v 1.19 2021/12/01 19:18:56 hauke Exp $
 
 BLAKE2s (lldpd-1.0.13.tar.gz) = c1a02e3d95101ddd0a8d2998172a81dd5af269f96ab730bf999d6d25508df60c
 SHA512 (lldpd-1.0.13.tar.gz) = b78440622882a822c9114c3617323ac3c8ce759040bb5b8a9f7357ca20e2993ab0130ee9ad85f65d5f38996665d599d70bbb9dd202e2557035e98545a4304aef
 Size (lldpd-1.0.13.tar.gz) = 1973988 bytes
+SHA1 (patch-src_daemon_interfaces-bsd.c) = 9088ded4f3e87fd700587811e9c89878e2de3936
 SHA1 (patch-src_daemon_lldpd.8.in) = 13f08e48123ae6a3edce43fa465823353955534e

File Added: pkgsrc/net/lldpd/patches/patch-src_daemon_interfaces-bsd.c
$NetBSD: patch-src_daemon_interfaces-bsd.c,v 1.3 2021/12/01 19:18:57 hauke Exp $

Upstream's patch to <https://github.com/lldpd/lldpd/issues/489>
"bridge0 is a bridge too big. Please, report the problem"

--- src/daemon/interfaces-bsd.c.orig	2021-09-22 07:17:57.000000000 +0000
+++ src/daemon/interfaces-bsd.c
@@ -72,11 +72,19 @@ ifbsd_check_bridge(struct lldpd *cfg,
     struct interfaces_device_list *interfaces,
     struct interfaces_device *master)
 {
-	struct ifbreq req[64];
-	struct ifbifconf bifc = {
-		.ifbic_len = sizeof(req),
-		.ifbic_req = req
-	};
+	static size_t ifbic_len = 64;
+	struct ifbreq *req = NULL;
+	struct ifbifconf bifc = {};
+
+ retry_alloc:
+	if ((req = realloc(req, ifbic_len)) == NULL) {
+		log_warn("interfaces", "unable to allocate memory to query bridge %s",
+		    master->name);
+		free(bifc.ifbic_req);
+		return;
+	}
+	bifc.ifbic_len = ifbic_len;
+	bifc.ifbic_req = req;
 
 #if defined HOST_OS_FREEBSD || defined HOST_OS_NETBSD || defined HOST_OS_OSX || defined HOST_OS_DRAGONFLY
 	struct ifdrv ifd = {
@@ -101,11 +109,9 @@ ifbsd_check_bridge(struct lldpd *cfg,
 #else
 # error Unsupported OS
 #endif
-	if (bifc.ifbic_len >= sizeof(req)) {
-		log_warnx("interfaces",
-		    "%s is a bridge too big. Please, report the problem",
-		    master->name);
-		return;
+	if (bifc.ifbic_len >= ifbic_len) {
+		ifbic_len = bifc.ifbic_len + 1;
+		goto retry_alloc;
 	}
 	for (int i = 0; i < bifc.ifbic_len / sizeof(*req); i++) {
 		struct interfaces_device *slave =