diff --git a/SOURCES/open-lldp-v1.0.1-24-fix-build-warnings.patch b/SOURCES/open-lldp-v1.0.1-24-fix-build-warnings.patch deleted file mode 100644 index f0facdb..0000000 --- a/SOURCES/open-lldp-v1.0.1-24-fix-build-warnings.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 2b5539cbf6baa72da39881f1d2b13aa325509998 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_util.c | 4 ++-- - 2 files changed, 2 insertions(+), 8 deletions(-) - -diff --git a/include/lldp_8021qaz.h b/include/lldp_8021qaz.h -index 55353b8..09dee20 100644 ---- a/include/lldp_8021qaz.h -+++ b/include/lldp_8021qaz.h -@@ -218,9 +218,6 @@ int ieee8021qaz_mod_app(struct app_tlv_head *head, int peer, - u8 prio, u8 sel, u16 proto, u32 ops); - int ieee8021qaz_app_sethw(char *ifname, struct app_tlv_head *head); - --inline int get_prio_map(u32 prio_map, int tc); --inline void set_prio_map(u32 *prio_map, u8 prio, int tc); -- - struct ieee8021qaz_tlvs *ieee8021qaz_data(const char *); - - int ieee8021qaz_tlvs_rxed(const char *ifname); -@@ -234,9 +231,6 @@ int ieee8021qaz_rchange(struct port *port, struct lldp_agent *, - void ieee8021qaz_ifup(char *ifname, struct lldp_agent *); - void ieee8021qaz_ifdown(char *ifname, struct lldp_agent *); - u8 ieee8021qaz_mibDeleteObject(struct port *port, struct lldp_agent *); --inline int ieee8021qaz_clif_cmd(void *data, struct sockaddr_un *from, -- socklen_t fromlen, char *ibuf, int ilen, -- char *rbuf); - int ieee8021qaz_check_operstate(void); - int get_dcbx_hw(const char *ifname, __u8 *dcbx); - -diff --git a/lldp_util.c b/lldp_util.c -index f1fb7b9..f36033d 100644 ---- a/lldp_util.c -+++ b/lldp_util.c -@@ -1177,7 +1177,7 @@ int check_link_status(const char *ifname) - int get_arg_val_list(char *ibuf, int ilen, int *ioff, - char **args, char **argvals) - { -- u8 arglen; -+ u8 arglen = 0; - u16 argvalue_len; - int *arglens = NULL; - int *argvallens = NULL; -@@ -1245,7 +1245,7 @@ int get_arg_val_list(char *ibuf, int ilen, int *ioff, - - int get_arg_list(char *ibuf, int ilen, int *ioff, char **args) - { -- u8 arglen; -+ u8 arglen = 0; - int *arglens = NULL; - int *p; - int numargs; --- -2.1.0 - diff --git a/SOURCES/open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch b/SOURCES/open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch new file mode 100644 index 0000000..916c079 --- /dev/null +++ b/SOURCES/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.5 + diff --git a/SOURCES/open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch b/SOURCES/open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch new file mode 100644 index 0000000..872c527 --- /dev/null +++ b/SOURCES/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.5 + diff --git a/SOURCES/open-lldp-v1.0.1-27-fix-build-warnings.patch b/SOURCES/open-lldp-v1.0.1-27-fix-build-warnings.patch new file mode 100644 index 0000000..405270c --- /dev/null +++ b/SOURCES/open-lldp-v1.0.1-27-fix-build-warnings.patch @@ -0,0 +1,94 @@ +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 ++-- + 4 files changed, 10 insertions(+), 11 deletions(-) + +diff --git a/include/lldp_8021qaz.h b/include/lldp_8021qaz.h +index 55353b8..09dee20 100644 +--- a/include/lldp_8021qaz.h ++++ b/include/lldp_8021qaz.h +@@ -218,9 +218,6 @@ int ieee8021qaz_mod_app(struct app_tlv_head *head, int peer, + u8 prio, u8 sel, u16 proto, u32 ops); + int ieee8021qaz_app_sethw(char *ifname, struct app_tlv_head *head); + +-inline int get_prio_map(u32 prio_map, int tc); +-inline void set_prio_map(u32 *prio_map, u8 prio, int tc); +- + struct ieee8021qaz_tlvs *ieee8021qaz_data(const char *); + + int ieee8021qaz_tlvs_rxed(const char *ifname); +@@ -234,9 +231,6 @@ int ieee8021qaz_rchange(struct port *port, struct lldp_agent *, + void ieee8021qaz_ifup(char *ifname, struct lldp_agent *); + void ieee8021qaz_ifdown(char *ifname, struct lldp_agent *); + u8 ieee8021qaz_mibDeleteObject(struct port *port, struct lldp_agent *); +-inline int ieee8021qaz_clif_cmd(void *data, struct sockaddr_un *from, +- socklen_t fromlen, char *ibuf, int ilen, +- char *rbuf); + 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 62f0af8..f12d46b 100644 +--- a/lldp_util.c ++++ b/lldp_util.c +@@ -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) + { +- u8 arglen; ++ u8 arglen = 0; + u16 argvalue_len; + int *arglens = NULL; + int *argvallens = NULL; +@@ -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) + { +- u8 arglen; ++ u8 arglen = 0; + int *arglens = NULL; + int *p; + int numargs; +-- +2.5.5 + diff --git a/SPECS/lldpad.spec b/SPECS/lldpad.spec index 278328a..b28626e 100644 --- a/SPECS/lldpad.spec +++ b/SPECS/lldpad.spec @@ -1,11 +1,11 @@ # https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags %define _hardened_build 1 -%global checkout 986eb2e +%global checkout 036e314 Name: lldpad Version: 1.0.1 -Release: 2.git%{checkout}%{?dist} +Release: 3.git%{checkout}%{?dist} Summary: Intel LLDP Agent Group: System Environment/Daemons License: GPLv2 @@ -35,8 +35,10 @@ Patch21: open-lldp-v1.0.1-21-lldpad-Fix-DCBX-event-generation-from-ll 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 # not upstream +Patch27: open-lldp-v1.0.1-27-fix-build-warnings.patch Patch99: lldpad-0.9.46-Ignore-supplied-PG-configuration-if-PG-is-being-disabled.patch Requires: kernel >= 2.6.32 @@ -130,6 +132,10 @@ fi %{_libdir}/liblldp_clif.so %changelog +* Wed Jul 06 2016 Chris Leech - 1.0.1-3.git036e314 +- 1273663 sync with upstream v1.0.1-26-g036e314 + system capability incorrect advertised as station only + * Wed Aug 12 2015 Chris Leech - 1.0.1-2.git986eb2e - convert from sysv shm to posix, to allow selinux restorecon (#1080287)