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 unified 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,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.37 2021/11/30 11:26:33 hauke Exp $ 1# $NetBSD: Makefile,v 1.38 2021/12/01 19:18:56 hauke Exp $
2 2
3DISTNAME= lldpd-1.0.13 3DISTNAME= lldpd-1.0.13
 4PKGREVISION= 1
4CATEGORIES= net 5CATEGORIES= net
5MASTER_SITES= http://media.luffy.cx/files/lldpd/ 6MASTER_SITES= http://media.luffy.cx/files/lldpd/
6 7
7MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
8HOMEPAGE= https://vincentbernat.github.com/lldpd/ 9HOMEPAGE= https://vincentbernat.github.com/lldpd/
9COMMENT= 802.1ab (LLDP) implementation 10COMMENT= 802.1ab (LLDP) implementation
10LICENSE= isc 11LICENSE= isc
11 12
12# interfaces-bsd.c:45:34: error: net/agr/if_agrioctl.h: No such file or directory 13# interfaces-bsd.c:45:34: error: net/agr/if_agrioctl.h: No such file or directory
13NOT_FOR_PLATFORM= NetBSD-5.*-* 14NOT_FOR_PLATFORM= NetBSD-5.*-*
14 15
15USE_TOOLS+= pkg-config 16USE_TOOLS+= pkg-config
16 17
@@ -48,26 +49,29 @@ PKG_HOME.${LLDPD_USER}= ${LLDPD_HOME} @@ -48,26 +49,29 @@ PKG_HOME.${LLDPD_USER}= ${LLDPD_HOME}
48 49
49SUBST_CLASSES+= files 50SUBST_CLASSES+= files
50SUBST_STAGE.files= pre-configure 51SUBST_STAGE.files= pre-configure
51SUBST_FILES.files= ../lldpd.conf 52SUBST_FILES.files= ../lldpd.conf
52SUBST_VARS.files= PKG_SYSCONFDIR 53SUBST_VARS.files= PKG_SYSCONFDIR
53SUBST_MESSAGE.files= Fixing default configuration file. 54SUBST_MESSAGE.files= Fixing default configuration file.
54 55
55INSTALLATION_DIRS+= sbin include lib 56INSTALLATION_DIRS+= sbin include lib
56INSTALLATION_DIRS+= ${PKGMANDIR}/man5 ${PKGMANDIR}/man8 57INSTALLATION_DIRS+= ${PKGMANDIR}/man5 ${PKGMANDIR}/man8
57INSTALLATION_DIRS+= ${EGDIR} share/doc 58INSTALLATION_DIRS+= ${EGDIR} share/doc
58INSTALLATION_DIRS+= share/bash-completion/completions 59INSTALLATION_DIRS+= share/bash-completion/completions
59INSTALLATION_DIRS+= share/zsh/site-functions 60INSTALLATION_DIRS+= share/zsh/site-functions
60 61
 62# Ownership and permission conflict with useradd?
 63#OWN_DIRS+= ${LLDPD_HOME}
 64
61TEST_TARGET= check 65TEST_TARGET= check
62 66
63.include "options.mk" 67.include "options.mk"
64 68
65post-patch: 69post-patch:
66 ${CP} ${PKGDIR}/files/lldpd.conf ${WRKDIR} 70 ${CP} ${PKGDIR}/files/lldpd.conf ${WRKDIR}
67 71
68post-install: 72post-install:
69 ${RM} -r ${DESTDIR}${PKG_SYSCONFDIR}/lldpd.d 73 ${RM} -r ${DESTDIR}${PKG_SYSCONFDIR}/lldpd.d
70 ${INSTALL_DATA} ${WRKDIR}/lldpd.conf \ 74 ${INSTALL_DATA} ${WRKDIR}/lldpd.conf \
71 ${DESTDIR}${PREFIX}/${EGDIR}/lldpd.conf 75 ${DESTDIR}${PREFIX}/${EGDIR}/lldpd.conf
72 76
73 77

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