Apply upstream's patch to <https://github.com/lldpd/lldpd/issues/489> "bridge0 is a bridge too big. Please, report the problem"diff -r1.37 -r1.38 pkgsrc/net/lldpd/Makefile
(hauke)
@@ -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 | |||
3 | DISTNAME= lldpd-1.0.13 | 3 | DISTNAME= lldpd-1.0.13 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= net | 5 | CATEGORIES= net | |
5 | MASTER_SITES= http://media.luffy.cx/files/lldpd/ | 6 | MASTER_SITES= http://media.luffy.cx/files/lldpd/ | |
6 | 7 | |||
7 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
8 | HOMEPAGE= https://vincentbernat.github.com/lldpd/ | 9 | HOMEPAGE= https://vincentbernat.github.com/lldpd/ | |
9 | COMMENT= 802.1ab (LLDP) implementation | 10 | COMMENT= 802.1ab (LLDP) implementation | |
10 | LICENSE= isc | 11 | LICENSE= 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 | |
13 | NOT_FOR_PLATFORM= NetBSD-5.*-* | 14 | NOT_FOR_PLATFORM= NetBSD-5.*-* | |
14 | 15 | |||
15 | USE_TOOLS+= pkg-config | 16 | USE_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 | |||
49 | SUBST_CLASSES+= files | 50 | SUBST_CLASSES+= files | |
50 | SUBST_STAGE.files= pre-configure | 51 | SUBST_STAGE.files= pre-configure | |
51 | SUBST_FILES.files= ../lldpd.conf | 52 | SUBST_FILES.files= ../lldpd.conf | |
52 | SUBST_VARS.files= PKG_SYSCONFDIR | 53 | SUBST_VARS.files= PKG_SYSCONFDIR | |
53 | SUBST_MESSAGE.files= Fixing default configuration file. | 54 | SUBST_MESSAGE.files= Fixing default configuration file. | |
54 | 55 | |||
55 | INSTALLATION_DIRS+= sbin include lib | 56 | INSTALLATION_DIRS+= sbin include lib | |
56 | INSTALLATION_DIRS+= ${PKGMANDIR}/man5 ${PKGMANDIR}/man8 | 57 | INSTALLATION_DIRS+= ${PKGMANDIR}/man5 ${PKGMANDIR}/man8 | |
57 | INSTALLATION_DIRS+= ${EGDIR} share/doc | 58 | INSTALLATION_DIRS+= ${EGDIR} share/doc | |
58 | INSTALLATION_DIRS+= share/bash-completion/completions | 59 | INSTALLATION_DIRS+= share/bash-completion/completions | |
59 | INSTALLATION_DIRS+= share/zsh/site-functions | 60 | INSTALLATION_DIRS+= share/zsh/site-functions | |
60 | 61 | |||
62 | # Ownership and permission conflict with useradd? | |||
63 | #OWN_DIRS+= ${LLDPD_HOME} | |||
64 | ||||
61 | TEST_TARGET= check | 65 | TEST_TARGET= check | |
62 | 66 | |||
63 | .include "options.mk" | 67 | .include "options.mk" | |
64 | 68 | |||
65 | post-patch: | 69 | post-patch: | |
66 | ${CP} ${PKGDIR}/files/lldpd.conf ${WRKDIR} | 70 | ${CP} ${PKGDIR}/files/lldpd.conf ${WRKDIR} | |
67 | 71 | |||
68 | post-install: | 72 | post-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 |
@@ -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 | |||
3 | BLAKE2s (lldpd-1.0.13.tar.gz) = c1a02e3d95101ddd0a8d2998172a81dd5af269f96ab730bf999d6d25508df60c | 3 | BLAKE2s (lldpd-1.0.13.tar.gz) = c1a02e3d95101ddd0a8d2998172a81dd5af269f96ab730bf999d6d25508df60c | |
4 | SHA512 (lldpd-1.0.13.tar.gz) = b78440622882a822c9114c3617323ac3c8ce759040bb5b8a9f7357ca20e2993ab0130ee9ad85f65d5f38996665d599d70bbb9dd202e2557035e98545a4304aef | 4 | SHA512 (lldpd-1.0.13.tar.gz) = b78440622882a822c9114c3617323ac3c8ce759040bb5b8a9f7357ca20e2993ab0130ee9ad85f65d5f38996665d599d70bbb9dd202e2557035e98545a4304aef | |
5 | Size (lldpd-1.0.13.tar.gz) = 1973988 bytes | 5 | Size (lldpd-1.0.13.tar.gz) = 1973988 bytes | |
6 | SHA1 (patch-src_daemon_interfaces-bsd.c) = 9088ded4f3e87fd700587811e9c89878e2de3936 | |||
6 | SHA1 (patch-src_daemon_lldpd.8.in) = 13f08e48123ae6a3edce43fa465823353955534e | 7 | SHA1 (patch-src_daemon_lldpd.8.in) = 13f08e48123ae6a3edce43fa465823353955534e |
$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 =