pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/lldpd Apply upstream's patch to <https://github.co...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ab36b27f1635
branches:  trunk
changeset: 770513:ab36b27f1635
user:      hauke <hauke%pkgsrc.org@localhost>
date:      Wed Dec 01 19:18:56 2021 +0000

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

diffstat:

 net/lldpd/Makefile                                  |   6 ++-
 net/lldpd/distinfo                                  |   3 +-
 net/lldpd/patches/patch-src_daemon_interfaces-bsd.c |  47 +++++++++++++++++++++
 3 files changed, 54 insertions(+), 2 deletions(-)

diffs (85 lines):

diff -r f81b0137c433 -r ab36b27f1635 net/lldpd/Makefile
--- a/net/lldpd/Makefile        Wed Dec 01 17:04:21 2021 +0000
+++ b/net/lldpd/Makefile        Wed Dec 01 19:18:56 2021 +0000
@@ -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/
 
@@ -58,6 +59,9 @@
 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
 
 .include "options.mk"
diff -r f81b0137c433 -r ab36b27f1635 net/lldpd/distinfo
--- a/net/lldpd/distinfo        Wed Dec 01 17:04:21 2021 +0000
+++ b/net/lldpd/distinfo        Wed Dec 01 19:18:56 2021 +0000
@@ -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
diff -r f81b0137c433 -r ab36b27f1635 net/lldpd/patches/patch-src_daemon_interfaces-bsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/lldpd/patches/patch-src_daemon_interfaces-bsd.c       Wed Dec 01 19:18:56 2021 +0000
@@ -0,0 +1,47 @@
+$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 =



Home | Main Index | Thread Index | Old Index