diff --git a/lldpad.spec b/lldpad.spec index bba8d9d..14966cd 100644 --- a/lldpad.spec +++ b/lldpad.spec @@ -3,7 +3,7 @@ # https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags %global _hardened_build 1 -%global checkout 986eb2e +%global checkout 036e314 Name: lldpad Version: 1.0.1 @@ -37,7 +37,9 @@ Patch21: open-lldp-v1.0.1-21-lldpad-Fix-DCBX-event-generation-from-lldpad.patch Patch22: open-lldp-v1.0.1-22-vdp-Fixed-the-memory-leak-for-modify-VSI-support-for.patch Patch23: open-lldp-v1.0.1-23-lldp-make-TTL-TLV-configurable.patch Patch24: open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch -Patch25: open-lldp-v1.0.1-24-fix-build-warnings.patch +Patch25: open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch +Patch26: open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch +Patch27: open-lldp-v1.0.1-27-fix-build-warnings.patch BuildRequires: automake autoconf libtool BuildRequires: flex >= 2.5.33 @@ -112,6 +114,7 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la %changelog * Mon Feb 01 2016 Chris Leech - 1.0.1-3.git986eb2e - 1303439 package should not attempt to own /etc/bash_completion.d +- fix more build warning in rawhide * Tue Nov 03 2015 Chris Leech - 1.0.1-2.git986eb2e - convert from sysv shm to posix, to allow selinux restorecon diff --git a/open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch b/open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch index 3c96a91..bbf3908 100644 --- a/open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch +++ b/open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch @@ -1,7 +1,7 @@ -From 3124c4b4537083618b82f230b05997c70096c897 Mon Sep 17 00:00:00 2001 +From 1add5db5feaafe7cbc41f2896f5c2887c96bff92 Mon Sep 17 00:00:00 2001 From: Chris Leech -Date: Mon, 20 Jul 2015 17:32:02 -0700 -Subject: [PATCH] switch from sysv to posix shared memory apis +Date: Sun, 16 Aug 2015 21:00:58 -0700 +Subject: [PATCH] lldpad: switch from sysv to posix shared memory apis The use of SysV shared memory, to pass state between running instances of lldpad in the initramfs and then from the root fs, is difficult to work @@ -16,7 +16,8 @@ a directory entry under /dev/shm/. This lets us add a file contents entry to the SELinux policy that matches that path, and a proper security context can be restored to it before restarting lldpad. -- Chris +Signed-off-by: Chris Leech +Signed-off-by: John Fastabend --- Makefile.am | 2 +- include/lldpad_shm.h | 2 +- @@ -419,5 +420,5 @@ index 4afcf73..d8bc0c5 100644 return rval; } -- -2.1.0 +2.5.0 diff --git a/open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch b/open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch new file mode 100644 index 0000000..0af32c7 --- /dev/null +++ b/open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch @@ -0,0 +1,37 @@ +From e212eb214afaea300194333f652b950941299339 Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 20 May 2015 16:14:37 +0000 +Subject: [PATCH] l2_linux_packet: correctly process return value of + get_perm_hwaddr + +On success get_perm_hwaddr() returns the number of bytes read from the +netlink socket. + +l2_packet_init() checked for 0 as a successful return value. + +Adopt get_perm_hwaddr() to return 0 on success. + +Refrence: bsc#929171 + +Signed-off-by: Johannes Thumshirn +Signed-off-by: John Fastabend +--- + lldp_rtnl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lldp_rtnl.c b/lldp_rtnl.c +index 33b4d19..8d4f0cc 100644 +--- a/lldp_rtnl.c ++++ b/lldp_rtnl.c +@@ -322,6 +322,8 @@ int get_perm_hwaddr(const char *ifname, u8 *buf_perm, u8 *buf_san) + + memcpy(buf_perm, RTA_DATA(rta), ETH_ALEN); + memcpy(buf_san, RTA_DATA(rta) + ETH_ALEN, ETH_ALEN); ++ ++ rc = 0; + out: + close(s); + out_nosock: +-- +2.5.0 + diff --git a/open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch b/open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch new file mode 100644 index 0000000..d065cec --- /dev/null +++ b/open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch @@ -0,0 +1,72 @@ +From 036e314bd93602f7388262cc37faf8b626980af1 Mon Sep 17 00:00:00 2001 +From: Gary Loughnane +Date: Mon, 17 Aug 2015 21:19:24 +0000 +Subject: [PATCH] lldpad: system capability incorrect advertised as station + only + +Fix system capability TLV on switch. On our switches we have found +that the system capability was being advertised as Station Only. This +patch changes the capability to Bridge. + +Signed-off-by: Gary Loughnane +Signed-off-by: John Fastabend +--- + include/lldp_util.h | 1 + + lldp_util.c | 22 +++++++++++++++++++++- + 2 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/include/lldp_util.h b/include/lldp_util.h +index 878426b..69b67b1 100644 +--- a/include/lldp_util.h ++++ b/include/lldp_util.h +@@ -125,6 +125,7 @@ int is_active(const char *ifname); + int is_bond(const char *ifname); + int is_san_mac(u8 *addr); + int is_bridge(const char *ifname); ++int is_bridge_port(const char *ifname); + int is_vlan(const char *ifname); + int is_vlan_capable(const char *ifname); + int is_wlan(const char *ifname); +diff --git a/lldp_util.c b/lldp_util.c +index f1fb7b9..62f0af8 100644 +--- a/lldp_util.c ++++ b/lldp_util.c +@@ -580,6 +580,26 @@ int is_bridge(const char *ifname) + return rc; + } + ++int is_bridge_port(const char *ifname) ++{ ++ int rc = 0; ++ char path[256]; ++ DIR *dirp; ++ ++ if (!is_ether(ifname)) { ++ return 0; ++ } ++ /* check if the given ifname is a bridge port in sysfs */ ++ snprintf(path, sizeof(path), "/sys/class/net/%s/brport/", ifname); ++ dirp = opendir(path); ++ if (dirp) { ++ closedir(dirp); ++ rc = 1; ++ } ++ ++ return rc; ++} ++ + int is_vlan(const char *ifname) + { + int fd; +@@ -942,7 +962,7 @@ u16 get_caps(const char *ifname) + if (is_vlan(ifname)) + caps |= SYSCAP_CVLAN; + +- if (is_bridge(ifname)) ++ if (is_bridge_port(ifname)) + caps |= SYSCAP_BRIDGE; + + if (is_router()) +-- +2.5.0 + diff --git a/open-lldp-v1.0.1-24-fix-build-warnings.patch b/open-lldp-v1.0.1-27-fix-build-warnings.patch similarity index 51% rename from open-lldp-v1.0.1-24-fix-build-warnings.patch rename to open-lldp-v1.0.1-27-fix-build-warnings.patch index f0facdb..5686fed 100644 --- a/open-lldp-v1.0.1-24-fix-build-warnings.patch +++ b/open-lldp-v1.0.1-27-fix-build-warnings.patch @@ -1,12 +1,14 @@ -From 2b5539cbf6baa72da39881f1d2b13aa325509998 Mon Sep 17 00:00:00 2001 +From 80fb9db6598440d3af6bdcbcd4f6788f7e660bbe Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Wed, 17 Jun 2015 10:40:34 -0700 Subject: [PATCH] fix build warnings --- include/lldp_8021qaz.h | 6 ------ + lldp/agent.c | 5 +++++ + lldp/agent.h | 6 +++--- lldp_util.c | 4 ++-- - 2 files changed, 2 insertions(+), 8 deletions(-) + 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/lldp_8021qaz.h b/include/lldp_8021qaz.h index 55353b8..09dee20 100644 @@ -32,11 +34,44 @@ index 55353b8..09dee20 100644 int ieee8021qaz_check_operstate(void); int get_dcbx_hw(const char *ifname, __u8 *dcbx); +diff --git a/lldp/agent.c b/lldp/agent.c +index 73ab054..333929a 100644 +--- a/lldp/agent.c ++++ b/lldp/agent.c +@@ -36,6 +36,11 @@ + #include "lldp_mand_clif.h" + #include "lldp/agent.h" + ++/* IEEE 802.1AB-2009 - Table 7-1: group MAC addresses used by LLDP */ ++const u8 nearest_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x0e}; ++const u8 nearest_nontpmr_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x03}; ++const u8 nearest_customer_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x00}; ++ + static const u8 * agent_groupmacs[AGENT_MAX] = { + nearest_bridge, + nearest_nontpmr_bridge, +diff --git a/lldp/agent.h b/lldp/agent.h +index a54f72f..90da3e0 100644 +--- a/lldp/agent.h ++++ b/lldp/agent.h +@@ -48,9 +48,9 @@ enum agent_type { + }; + + /* IEEE 802.1AB-2009 - Table 7-1: group MAC addresses used by LLDP */ +-static const u8 nearest_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x0e}; +-static const u8 nearest_nontpmr_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x03}; +-static const u8 nearest_customer_bridge[ETH_ALEN] = {0x01,0x80,0xc2,0x00,0x00,0x00}; ++extern const u8 nearest_bridge[ETH_ALEN]; ++extern const u8 nearest_nontpmr_bridge[ETH_ALEN]; ++extern const u8 nearest_customer_bridge[ETH_ALEN]; + + struct agenttimers { + /* Tx */ diff --git a/lldp_util.c b/lldp_util.c -index f1fb7b9..f36033d 100644 +index 62f0af8..f12d46b 100644 --- a/lldp_util.c +++ b/lldp_util.c -@@ -1177,7 +1177,7 @@ int check_link_status(const char *ifname) +@@ -1197,7 +1197,7 @@ int check_link_status(const char *ifname) int get_arg_val_list(char *ibuf, int ilen, int *ioff, char **args, char **argvals) { @@ -45,7 +80,7 @@ index f1fb7b9..f36033d 100644 u16 argvalue_len; int *arglens = NULL; int *argvallens = NULL; -@@ -1245,7 +1245,7 @@ int get_arg_val_list(char *ibuf, int ilen, int *ioff, +@@ -1265,7 +1265,7 @@ int get_arg_val_list(char *ibuf, int ilen, int *ioff, int get_arg_list(char *ibuf, int ilen, int *ioff, char **args) { @@ -55,5 +90,5 @@ index f1fb7b9..f36033d 100644 int *p; int numargs; -- -2.1.0 +2.5.0