Bug 210390 - net-mgmt/lldpd: Update to 0.9.4
Summary: net-mgmt/lldpd: Update to 0.9.4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason Unovitch
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2016-06-19 15:33 UTC by Mathieu Simon
Modified: 2016-07-03 17:54 UTC (History)
2 users (show)

See Also:


Attachments
Update lldpd to 0.9.4 (4.03 KB, patch)
2016-06-19 15:35 UTC, Mathieu Simon
freebsd: maintainer-approval+
Details | Diff
Update lldpd to 0.9.4 (3.95 KB, patch)
2016-06-23 06:46 UTC, Mathieu Simon
freebsd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Simon 2016-06-19 15:33:03 UTC
Hi

We're already at lldpd 0.9.4, so it's time to update the port:

The diff has been :
- "poudriere testport"-ed on 9.3-amd64/i386 and 10.3-amd64/i386 jails
- Quick runtime test against an actual LLDP neighbor on 10.3-amd64
- Build and quick runtime test on DragonFly BSD 4.4

0.9.3 was skipped due to issues with BSD make which upstream fixed in 0.9.4.
 
Extra patches are taken from from upstream right after 0.9.4 was released:
- Fix build issues with 9.3's older cpp not supporting mutiple files as input.
 (likely Tier 2 archs with GCC 4.2 too)
- Fix a regression which was caused by importing/adding support for new 
  OpenBSD ifmediareq changes* and the use of typeof in 0.9.4

Once 0.9.5 or newer gets released, these patches can be be dropped. The upstream author has been very supportive in resolving reported issues on FreeBSD.

For upstream changelog since 0.9.2 see:
https://raw.githubusercontent.com/vincentbernat/lldpd/0.9.4/NEWS

News on the port:
lldpd(8) now shows the right path to lldpd config files / directories.

Looking forward for integration.

-- Mathieu

* http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/net/if.h#rev1.167
Comment 1 Mathieu Simon 2016-06-19 15:35:23 UTC
Created attachment 171577 [details]
Update lldpd to 0.9.4
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2016-06-23 06:09:10 UTC
Why do you add the dependency on ports-mgmt/pkg ?
Comment 3 Mathieu Simon 2016-06-23 06:44:38 UTC
Hi Kurt

Thanks for asking, I don't always test all possible combinations of options when updating the port but don't remember 'poudriere testport' previously reporting this:

[...]
===========================================================================
====> Running Q/A tests (stage-qa)
Error: /usr/local/sbin/lldpd is linked to /usr/local/lib/libpkg.so.3 from ports-mgmt/pkg but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libpkg.so:ports-mgmt/pkg
[...]

And I think it's due to the resulting linking here:

# ldd /usr/local/sbin/lldpd | grep pkg
        libpkg.so.3 => /usr/local/lib/libpkg.so.3 (0x802212000)

Instead of depending blindly on libpkg I revisited that and was able to see that this dependency only gets added if SNMP is enabled (which is a default option)

Let me know what you think about, I'm definitely not an expert in that area.
I'll upload an updated patch correctly reflecting the more precise dependency now.

-- Mathieu
Comment 4 Mathieu Simon 2016-06-23 06:46:55 UTC
Created attachment 171698 [details]
Update lldpd to 0.9.4

Updated patch, declares libpkg dependency correctly which only happens if SNMP is enabled.
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2016-06-23 07:02:57 UTC
The binary should never require the libpkg.so. I'll ask the pkg maintainer.
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2016-06-23 18:15:58 UTC
instead of ldd can you run readelf -d on the binary and show the output.

the link is due to netsnmp dependency which is linked to pkg but should not overlink otherwise the bug is on the netsnmp side
Comment 7 Mathieu Simon 2016-06-23 18:23:54 UTC
Hi Baptiste

Here you go, with just SNMP enabled in the port so here you go:

# readelf -d /usr/local/sbin/lldpd

Dynamic section at offset 0x20780 contains 36 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libevent-2.0.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libkvm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libdevstat.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmpmibs.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmpagent.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libwrap.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmp.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libelf.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpkg.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]
 0x000000000000000f (RPATH)              Library rpath: [/usr/local/lib/perl5/5.20/mach/CORE]
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/local/lib/perl5/5.20/mach/CORE]
 0x000000000000000c (INIT)               0x403828
 0x000000000000000d (FINI)               0x418b08
 0x0000000000000004 (HASH)               0x400280
 0x000000006ffffef5 (GNU_HASH)           0x400798
 0x0000000000000005 (STRTAB)             0x401a98
 0x0000000000000006 (SYMTAB)             0x400880
 0x000000000000000a (STRSZ)              2644 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x620a10
 0x0000000000000002 (PLTRELSZ)           3768 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x402970
 0x0000000000000007 (RELA)               0x4026a0
 0x0000000000000008 (RELASZ)             720 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW
 0x000000006ffffffe (VERNEED)            0x402670
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x4024ec
 0x0000000000000000 (NULL)               0x0

If there is anything else I can provide, let me know.

-- Mathieu
Comment 8 Kurt Jaeger freebsd_committer freebsd_triage 2016-06-23 18:24:26 UTC
I've tested on my 11a build:

Dynamic section at offset 0x26770 contains 36 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libevent-2.0.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libkvm.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libdevstat.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmpmibs.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmpagent.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libwrap.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libnetsnmp.so.30]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libelf.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libpkg.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]
 0x000000000000000f (RPATH)              Library rpath: [/usr/local/lib/perl5/5.22/mach/CORE]
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/local/lib/perl5/5.22/mach/CORE]
 0x000000000000000c (INIT)               0x4038a8
 0x000000000000000d (FINI)               0x41bf08
 0x0000000000000004 (HASH)               0x400280
 0x000000006ffffef5 (GNU_HASH)           0x4007a0
 0x0000000000000005 (STRTAB)             0x401ad0
 0x0000000000000006 (SYMTAB)             0x400888
 0x000000000000000a (STRSZ)              2661 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x626a00
 0x0000000000000002 (PLTRELSZ)           3816 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x4029c0
 0x0000000000000007 (RELA)               0x4026f0
 0x0000000000000008 (RELASZ)             720 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW
 0x000000006ffffffe (VERNEED)            0x4026c0
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x402536
 0x0000000000000000 (NULL)               0x0
Comment 9 Baptiste Daroussin freebsd_committer freebsd_triage 2016-06-25 12:14:35 UTC
Right so the bug is what I expected in the netsnmp part is exposes pkg API which is wrong imho
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-06-25 23:47:43 UTC
A commit references this bug:

Author: junovitch
Date: Sat Jun 25 23:47:23 UTC 2016
New revision: 417507
URL: https://svnweb.freebsd.org/changeset/ports/417507

Log:
  net-mgmt/lldpd: update 0.9.2 -> 0.9.4

  - Fix lldpd(8) in post-patch to show correct lldpd config file/directory path.
  - Apply extra patches taken from upstream right after 0.9.4 was released:
  * Fix build issues with 9.3's older cpp not supporting mutiple files as input.
    (likely Tier 2 archs with GCC 4.2 too)
  * Fix a regression which was caused by importing/adding support for new
    OpenBSD ifmediareq changes* and the use of typeof in 0.9.4

  lldpd (0.9.3)
  * Do not rely on support of constructors for liblldpctl.
  * Always log to stderr (even in addition to syslog).
  * `lldpcli watch` accepts a limit on the number of received events.
  * `lldpcli -f {xml,json} watch` should work now.
  * Consider `veth` interfaces as physical interfaces.

  lldpd (0.9.4)
  * Make lldpd accepts a `-p` option to specify the PID file.
  * Ability to change multicast MAC address to two additional values to reach
    customer bridges.
  * lldpcli will now display chassis TTL when detailed view is enabled.
  * Fix setting of local value for port ID.
  * Fix compilation with BSD make.
  * Ensure lldpcli returns an error code on invalid commands.

  PR:		210390
  Submitted by:	Mathieu Simon <freebsd@simweb.ch> (maintainer)

Changes:
  head/net-mgmt/lldpd/Makefile
  head/net-mgmt/lldpd/distinfo
  head/net-mgmt/lldpd/files/patch-configure.ac
  head/net-mgmt/lldpd/files/patch-src_daemon_interfaces-bsd.c
  head/net-mgmt/lldpd/files/patch-src_lib_Makefile.in
Comment 11 Jason Unovitch freebsd_committer freebsd_triage 2016-06-25 23:50:05 UTC
The linking was happening with the current version as well:

Makefile ident:      $FreeBSD: head/net-mgmt/lldpd/Makefile 413753 2016-04-21 19:29:14Z pi $
...
====> Running Q/A tests (stage-qa)
Error: /usr/local/sbin/lldpd is linked to /usr/local/lib/libpkg.so.3 from ports-mgmt/pkg but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libpkg.so:ports-mgmt/pkg

I'm taking a brief look at net-snmp now but since the port is no better or worse regrading the bad linking to net-snmp I've gone and committed the update sans addressing that part of the QA.
Comment 12 Mathieu Simon 2016-06-27 06:00:03 UTC
Thank you Jason for commiting the patch!