From 95d944ce8e2e517b6993294599f5a56ab03ce871 Mon Sep 17 00:00:00 2001 From: Stephen Walker Date: Sat, 23 Jun 2012 20:06:33 +0000 Subject: [PATCH] [packages] lldpd: update to 0.6.0, remove default/obsolete CONFIGURE_{ARGS,VARS}, use PKG_INSTALL SVN-Revision: 32494 --- net/lldpd/Makefile | 44 +++++++---------- net/lldpd/files/lldpd.init | 8 ++- net/lldpd/patches/001-no-multiuser.patch | 49 +++++++++---------- .../patches/002-no-stack-protector.patch | 10 ++++ 4 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 net/lldpd/patches/002-no-stack-protector.patch diff --git a/net/lldpd/Makefile b/net/lldpd/Makefile index 93bcbfcf38..a39fff0580 100644 --- a/net/lldpd/Makefile +++ b/net/lldpd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2008-2011 OpenWrt.org +# Copyright (C) 2008-2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=0.3 -PKG_RELEASE:=3 +PKG_VERSION:=0.6.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.luffy.cx/lldpd/ -PKG_MD5SUM:=317e1144ec7d2781ff123ec16845a2fc +PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd +PKG_MD5SUM:=77279577e3b6d85a33dc0afe7c960b27 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -21,36 +24,25 @@ define Package/lldpd SECTION:=net CATEGORY:=Network SUBMENU:=Routing and Redirection - TITLE:=Link Layer Discovery Protocol damon - URL:=https://trac.luffy.cx/lldpd/ + TITLE:=Link Layer Discovery Protocol daemon + URL:=https://github.com/vincentbernat/lldpd/wiki + DEPENDS:=+libevent2 endef define Package/lldpd/description - LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed - to supplant proprietary Link-Layer protocols such as - Extreme's EDP (Extreme Discovery Protocol) and - CDP (Cisco Discovery Protocol). - The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver - Link-Layer notifications to adjacent network devices. + LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed + to supplant proprietary Link-Layer protocols such as + Extreme's EDP (Extreme Discovery Protocol) and + CDP (Cisco Discovery Protocol). + The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver + Link-Layer notifications to adjacent network devices. endef -CONFIGURE_ARGS += \ - --enable-cdp \ - --enable-fdp \ - --enable-edp \ - --enable-lldpmed \ - --enable-dot1 \ - --enable-dot3 \ - -CONFIGURE_VARS += \ - ac_cv_lib_nl_nl_connect=no - define Package/lldpd/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lldpd $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lldpctl $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lldp{ctl,d} $(1)/usr/sbin/ $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd $(INSTALL_DATA) ./files/lldpd.config $(1)/etc/config/lldpd endef diff --git a/net/lldpd/files/lldpd.init b/net/lldpd/files/lldpd.init index a627056f71..5d34283883 100644 --- a/net/lldpd/files/lldpd.init +++ b/net/lldpd/files/lldpd.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2008-2011 OpenWrt.org +# Copyright (C) 2008-2012 OpenWrt.org START=90 @@ -27,8 +27,12 @@ start() { [ $enable_edp -gt 0 ] && append args '-e' service_start /usr/sbin/lldpd $args \ - ${lldp_location:+ -L "$lldp_location"} \ ${lldp_class:+ -M $lldp_class} + + [ -n "$lldp_location" ] && { + sleep 1 + /usr/sbin/lldpctl -L "$lldp_location" > /dev/null 2>&1 + } } stop() { diff --git a/net/lldpd/patches/001-no-multiuser.patch b/net/lldpd/patches/001-no-multiuser.patch index 965dd0d096..5f216c4289 100644 --- a/net/lldpd/patches/001-no-multiuser.patch +++ b/net/lldpd/patches/001-no-multiuser.patch @@ -1,7 +1,6 @@ -diff -urb lldpd-0.3.orig/src/priv.c lldpd-0.3/src/priv.c ---- lldpd-0.3.orig/src/priv.c 2008-12-30 07:35:28.000000000 +0100 -+++ lldpd-0.3/src/priv.c 2008-12-30 07:40:55.000000000 +0100 -@@ -522,12 +522,14 @@ +--- a/src/priv.c ++++ b/src/priv.c +@@ -518,12 +518,14 @@ priv_init(char *chrootdir) fatal("[priv]: unable to create socket pair for privilege separation"); /* Get users */ @@ -16,26 +15,26 @@ diff -urb lldpd-0.3.orig/src/priv.c lldpd-0.3/src/priv.c /* Spawn off monitor */ if ((monitored = fork()) < 0) -@@ -535,17 +537,17 @@ - switch (monitored) { - case 0: - /* We are in the children, drop privileges */ -- if (chroot(chrootdir) == -1) -- fatal("[priv]: unable to chroot"); -- if (chdir("/") != 0) -+ /*if (chroot(chrootdir) == -1) -+ fatal("[priv]: unable to chroot");*/ -+ if (chdir("/tmp") != 0) - fatal("[priv]: unable to chdir"); - gidset[0] = gid; -- if (setresgid(gid, gid, gid) == -1) -+ /*if (setresgid(gid, gid, gid) == -1) - fatal("[priv]: setresgid() failed"); - if (setgroups(1, gidset) == -1) - fatal("[priv]: setgroups() failed"); - if (setresuid(uid, uid, uid) == -1) -- fatal("[priv]: setresuid() failed"); -+ fatal("[priv]: setresuid() failed");*/ +@@ -534,17 +536,17 @@ priv_init(char *chrootdir) + if (RUNNING_ON_VALGRIND) + LLOG_WARNX("[priv]: running on valgrind, keep privileges"); + else { +- if (chroot(chrootdir) == -1) +- fatal("[priv]: unable to chroot"); +- if (chdir("/") != 0) ++ /*if (chroot(chrootdir) == -1) ++ fatal("[priv]: unable to chroot");*/ ++ if (chdir("/tmp") != 0) + fatal("[priv]: unable to chdir"); + gidset[0] = gid; +- if (setresgid(gid, gid, gid) == -1) ++ /*if (setresgid(gid, gid, gid) == -1) + fatal("[priv]: setresgid() failed"); + if (setgroups(1, gidset) == -1) + fatal("[priv]: setgroups() failed"); + if (setresuid(uid, uid, uid) == -1) +- fatal("[priv]: setresuid() failed"); ++ fatal("[priv]: setresuid() failed");*/ + } remote = pair[0]; close(pair[1]); - priv_ping(); diff --git a/net/lldpd/patches/002-no-stack-protector.patch b/net/lldpd/patches/002-no-stack-protector.patch new file mode 100644 index 0000000000..0a0c6fbb69 --- /dev/null +++ b/net/lldpd/patches/002-no-stack-protector.patch @@ -0,0 +1,10 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -48,7 +48,6 @@ AX_CFLAGS_GCC_OPTION([-Wformat]) + AX_CFLAGS_GCC_OPTION([-Wformat-security]) + AX_CFLAGS_GCC_OPTION([-Wcast-align]) + AX_CFLAGS_GCC_OPTION([-Winline]) +-AX_CFLAGS_GCC_OPTION([-fstack-protector]) + AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2]) + AX_CFLAGS_GCC_OPTION([-Wdeclaration-after-statement]) + AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter]) -- 2.30.2