From d5ef94c40fb911f136f18ed563a63269cd7a557e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:22:26 +0000 Subject: import fcoe-utils-1.0.31-1.git5dfd3e4.el7 --- diff --git a/.fcoe-utils.metadata b/.fcoe-utils.metadata index 7a46f9c..b11c9ca 100644 --- a/.fcoe-utils.metadata +++ b/.fcoe-utils.metadata @@ -1 +1 @@ -3bc379798b8b74367ee0ba42184f9f8c5cc664d8 SOURCES/fcoe-utils-1.0.30.tar.gz +d5fea62807b108aaeb7ae9dee814c3e0249a5ffd SOURCES/fcoe-utils-1.0.31.tar.gz diff --git a/.gitignore b/.gitignore index e12b663..a3e047a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/fcoe-utils-1.0.30.tar.gz +SOURCES/fcoe-utils-1.0.31.tar.gz diff --git a/SOURCES/README.redhat b/SOURCES/README.redhat new file mode 100644 index 0000000..04b96d7 --- /dev/null +++ b/SOURCES/README.redhat @@ -0,0 +1,21 @@ + FCoE Management Tools + ===================== + +The FCoE Management Tools included in this package are + + fcoeadm - program to create, reset, destroy, and display FCoE interfaces + fcoemon - program to monitor the events from the DCB daemon + +Requirements: + +The HBAAPI library and the HBAAPI vendor library are required for the +management tools. They should be installed as dependancies of the fcoe-utils +RPM, and are provided by the libhbaapi and libhbalinux RPMs. + +Best Practices : + +The FCoE systemd services should be properly ordered against networking and +filesystem units. But, in order to work properly any filesystems that reside +on FCoE attached storage should have the _netdev flag set in the mount options +field of their /etc/fstab entry. + diff --git a/SOURCES/fcoe-utils-v1.0.30-1-fcoemon-Rework-daemonizing-and-error-handling.patch b/SOURCES/fcoe-utils-v1.0.30-1-fcoemon-Rework-daemonizing-and-error-handling.patch deleted file mode 100644 index 320ecd9..0000000 --- a/SOURCES/fcoe-utils-v1.0.30-1-fcoemon-Rework-daemonizing-and-error-handling.patch +++ /dev/null @@ -1,78 +0,0 @@ -From f3af6bad75d7f6c90b9a170cbf9e4748ab4bb24e Mon Sep 17 00:00:00 2001 -From: Johannes Thumshirn -Date: Mon, 18 May 2015 17:02:59 +0000 -Subject: [PATCH] fcoemon: Rework daemonizing and error handling - -Rework error handling, which leads to daemonizing later in order to get the -error handling into effect. - -Signed-off-by: Johannes Thumshirn -Signed-off-by: Vasu Dev ---- - fcoemon.c | 31 ++++++++++++++++++++++--------- - 1 file changed, 22 insertions(+), 9 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index 3b5210c..c5edd1b 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -3719,11 +3719,6 @@ int main(int argc, char **argv) - if (argc != optind) - fcm_usage(); - -- if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) { -- FCM_LOG("Starting daemon failed"); -- exit(EXIT_FAILURE); -- } -- - umask(0); - - /* -@@ -3770,22 +3765,40 @@ int main(int argc, char **argv) - } - - fcm_fcoe_init(); -- fcm_fc_events_init(); -- fcm_link_init(); /* NETLINK_ROUTE protocol */ -+ rc = fcm_fc_events_init(); -+ if (rc != 0) -+ exit(1); -+ -+ rc = fcm_link_init(); /* NETLINK_ROUTE protocol */ -+ if (rc != 0) -+ goto err_cleanup; -+ - fcm_dcbd_init(); -- fcm_srv_create(&srv_info); -+ rc = fcm_srv_create(&srv_info); -+ if (rc != 0) -+ goto err_cleanup; -+ -+ if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) { -+ FCM_LOG("Starting daemon failed"); -+ goto err_cleanup; -+ } -+ - sa_select_set_callback(fcm_handle_changes); - - rc = sa_select_loop(); - if (rc < 0) { - FCM_LOG_ERR(rc, "select error\n"); -- exit(EXIT_FAILURE); -+ goto err_cleanup; - } - fcm_dcbd_shutdown(); - fcm_srv_destroy(&srv_info); - if (rc == SIGHUP) - fcm_cleanup(); - return 0; -+ -+err_cleanup: -+ fcm_cleanup(); -+ exit(1); - } - - /******************************************************* --- -2.1.0 - diff --git a/SOURCES/fcoe-utils-v1.0.30-2-fcoemon-fix-IEEE-state-machine.patch b/SOURCES/fcoe-utils-v1.0.30-2-fcoemon-fix-IEEE-state-machine.patch deleted file mode 100644 index 3af11b9..0000000 --- a/SOURCES/fcoe-utils-v1.0.30-2-fcoemon-fix-IEEE-state-machine.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 91c0c8c0a37af40b3fb4a37df6490a226348d152 Mon Sep 17 00:00:00 2001 -From: Vasu Dev -Date: Fri, 5 Jun 2015 14:52:10 -0700 -Subject: [PATCH] fcoemon: fix IEEE state machine - -Fix IEEE state machine for these issues:- - - - fcoeadm scan not working - - fcoeadm reset not working - - periodic fipvlan issuance even after fcoe instance created - -These issues are due to current IEEE states are not correctly -handled. The validate_ieee_info() return either activate or -wait actions and out of that only activate is really used to -enable fcoe instance and none other action are applicable in -IEEE state machine, so reduced to only activate and then -advance the state machine to new IEEE_ACTIVE state to allow -processing of scan & reset command once interface activated. - -This also fixes fipvlan issuance issue beside fixing scan and -reset fcoeadm commands. - -Signed-off-by: Vasu Dev -Tested-By: Jack Morgan ---- - fcoemon.c | 19 +++++++------------ - fcoemon.h | 1 + - 2 files changed, 8 insertions(+), 12 deletions(-) - -diff --git a/fcoemon.c b/fcoemon.c -index c5edd1b..c0af99b 100644 ---- a/fcoemon.c -+++ b/fcoemon.c -@@ -1341,6 +1341,7 @@ STR_ARR(ieee_states, "Unknown", "Out of range", - [IEEE_INIT] = "IEEE_INIT", - [IEEE_GET_STATE] = "IEEE_GET_STATE", - [IEEE_DONE] = "IEEE_DONE", -+ [IEEE_ACTIVE] = "IEEE_ACTIVE", - ); - - static void -@@ -3054,20 +3055,14 @@ static void fcm_netif_ieee_advance(struct fcm_netif *ff) - break; - case IEEE_DONE: - action = validate_ieee_info(ff); -- switch (action) { -- case FCP_DESTROY_IF: -- case FCP_ENABLE_IF: -- case FCP_ACTIVATE_IF: -+ if (action == FCP_ACTIVATE_IF) { - fcp_action_set(ff->ifname, action); -- break; -- case FCP_DISABLE_IF: -- case FCP_ERROR: -- fcp_action_set(ff->ifname, FCP_DISABLE_IF); -- break; -- case FCP_WAIT: -- default: -- break; -+ ieee_state_set(ff, IEEE_ACTIVE); - } -+ break; -+ case IEEE_ACTIVE: -+ /* TBD enable and disable if needed in IEEE mode */ -+ break; - default: - break; - } -diff --git a/fcoemon.h b/fcoemon.h -index c2ed7b1..3869bae 100644 ---- a/fcoemon.h -+++ b/fcoemon.h -@@ -80,6 +80,7 @@ enum ieee_state { - IEEE_INIT = 0, /* Starting state */ - IEEE_GET_STATE, /* Getting IEEE DCB state */ - IEEE_DONE, /* Received IEEE DCB state */ -+ IEEE_ACTIVE, /* IEEE is in ACTIVE state */ - IEEE_ERROR, /* Error receiving IEEE DCB state */ - }; - --- -2.1.0 - diff --git a/SOURCES/fcoe-utils-v1.0.30-fcoeadm-fix-display-when-some-netdevs-don-t-have-ser.patch b/SOURCES/fcoe-utils-v1.0.30-fcoeadm-fix-display-when-some-netdevs-don-t-have-ser.patch deleted file mode 100644 index 92d7800..0000000 --- a/SOURCES/fcoe-utils-v1.0.30-fcoeadm-fix-display-when-some-netdevs-don-t-have-ser.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cc0037c0091a2b9baf04a5101ec83a6ec8db448b Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Mon, 6 Jul 2015 20:43:56 -0700 -Subject: [PATCH] fcoeadm: fix display when some netdevs don't have serial - numbers - ---- - fcoeadm_display.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/fcoeadm_display.c b/fcoeadm_display.c -index 9b96170..3b7fff9 100644 ---- a/fcoeadm_display.c -+++ b/fcoeadm_display.c -@@ -1294,9 +1294,8 @@ enum fcoe_status display_adapter_info(const char *ifname) - continue; - } - -- if (!strncmp(hba_attrs->SerialNumber, -- shba_attrs->SerialNumber, -- strlen(hba_attrs->SerialNumber))) { -+ if (!strcmp(hba_attrs->SerialNumber, -+ shba_attrs->SerialNumber)) { - show_port_info(sport_attrs); - hba_table_list->hba_table[j].displayed = 1; - } --- -2.1.0 - diff --git a/SOURCES/fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch b/SOURCES/fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch new file mode 100644 index 0000000..84c8af1 --- /dev/null +++ b/SOURCES/fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch @@ -0,0 +1,74 @@ +From 0231b0c71464af17a0cf392e55174c97a5986640 Mon Sep 17 00:00:00 2001 +From: "Milan P. Gandhi" +Date: Mon, 28 Mar 2016 12:52:12 +0000 +Subject: [PATCH] fcoemon.c: Add a check to verify if dcbd is to be + initialized, else do not try to connect to dcbd/lldpad + +Some of the FCoE capable adapters e.g. BCM57810 network interfaces +has DCBX/LLDP client on-chip, and kernel documentation recommends +to keep software based DCBX/LLDP clients (e.g. lldpad) disabled. +https://www.kernel.org/doc/Documentation/scsi/bnx2fc.txt + +It was found that, if lldpad is disabled while using above interfaces, +then fcoemon shows following errors every 10 seconds: + +fcoemon: error 111 Connection refused +fcoemon: Failed to connect to lldpad + +Below patch checks each interface configuration in /etc/fcoe/cfg-ethX +file to verify if there is at least 1 interface with DCB_REQUIRED flag +set to yes and will try to initialize dcbd only if there is at least 1 +interface with DCB_REQUIRED="yes", else fcoemon will not try to +initialize dcbd or connect to lldpad, thus eliminating above errors: + +Signed-off-by: Milan P. Gandhi +Reviewed-by: Johannes Thumshirn +Reviewed-by: Laurence Oberman +Tested-by: Laurence Oberman +Reviewed-by: Johannes Thumshirn +Signed-off-by: Vasu Dev +--- + fcoemon.c | 7 ++++++- + fcoemon.h | 1 + + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/fcoemon.c b/fcoemon.c +index 91d12c7..d84d1e5 100644 +--- a/fcoemon.c ++++ b/fcoemon.c +@@ -557,6 +557,9 @@ static int fcm_read_config_files(void) + if (!strncasecmp(val, "yes", 3) && rc == 1) + next->dcb_required = 1; + ++ if (next->dcb_required == 1 && fcoe_config.dcb_init == 0) ++ fcoe_config.dcb_init = 1; ++ + /* AUTO_VLAN */ + rc = fcm_read_config_variable(file, val, sizeof(val), + fp, CFG_IF_VAR_AUTOVLAN); +@@ -3768,7 +3771,9 @@ int main(int argc, char **argv) + if (rc != 0) + goto err_cleanup; + +- fcm_dcbd_init(); ++ if (fcoe_config.dcb_init) ++ fcm_dcbd_init(); ++ + rc = fcm_srv_create(&srv_info); + if (rc != 0) + goto err_cleanup; +diff --git a/fcoemon.h b/fcoemon.h +index 3869bae..0e0e6a2 100644 +--- a/fcoemon.h ++++ b/fcoemon.h +@@ -25,6 +25,7 @@ + struct fcoe_config { + int debug; + int use_syslog; ++ int dcb_init; + struct fcoe_port *port; + } fcoe_config; + +-- +2.5.5 + diff --git a/SOURCES/fcoe-utils-v1.0.31-2-fcoeadm-Fix-possible-buffer-overflows.patch b/SOURCES/fcoe-utils-v1.0.31-2-fcoeadm-Fix-possible-buffer-overflows.patch new file mode 100644 index 0000000..91cfa33 --- /dev/null +++ b/SOURCES/fcoe-utils-v1.0.31-2-fcoeadm-Fix-possible-buffer-overflows.patch @@ -0,0 +1,45 @@ +From 5dfd3e4fab6cc4261112ad6a6839d4eb584cacfc Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 15 Jun 2016 22:47:41 +0000 +Subject: [PATCH] fcoeadm: Fix possible buffer overflows + +Fix 3 possible buffer overflows when strncat()ing strings together. + +Signed-off-by: Johannes Thumshirn +Signed-off-by: Vasu Dev +--- + fcoeadm_display.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fcoeadm_display.c b/fcoeadm_display.c +index 16ccb6b..7b95aa4 100644 +--- a/fcoeadm_display.c ++++ b/fcoeadm_display.c +@@ -267,13 +267,13 @@ static void show_full_lun_info(unsigned int hba, unsigned int port, + if (!port_attrs) + goto free_rport; + +- strncat(path, "/device/", sizeof(path)); ++ strncat(path, "/device/", sizeof(path) - strlen(path) - 1); + + sa_sys_read_line(path, "rev", rev, sizeof(rev)); + sa_sys_read_line(path, "model", model, sizeof(model)); + sa_sys_read_line(path, "vendor", vendor, sizeof(vendor)); + +- strncat(path, "block", sizeof(path)); ++ strncat(path, "block", sizeof(path) - strlen(path) - 1); + + dir = opendir(path); + if (!dir) +@@ -349,7 +349,7 @@ static void show_short_lun_info(unsigned int hba, unsigned int port, + sa_sys_read_line(path, "model", model, sizeof(model)); + sa_sys_read_line(path, "vendor", vendor, sizeof(vendor)); + +- strncat(path, "block", sizeof(path)); ++ strncat(path, "block", sizeof(path) - strlen(path) - 1); + + dir = opendir(path); + if (!dir) +-- +2.5.5 + diff --git a/SPECS/fcoe-utils.spec b/SPECS/fcoe-utils.spec index 80de7bd..e942ff4 100644 --- a/SPECS/fcoe-utils.spec +++ b/SPECS/fcoe-utils.spec @@ -1,34 +1,35 @@ # https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags %define _hardened_build 1 -%global checkout 91c0c8c +%global checkout 5dfd3e4 Name: fcoe-utils -Version: 1.0.30 -Release: 3.git%{checkout}%{?dist} +Version: 1.0.31 +Release: 1.git%{checkout}%{?dist} Summary: Fibre Channel over Ethernet utilities Group: Applications/System License: GPLv2 URL: http://www.open-fcoe.org # git://open-fcoe.org/fcoe/fcoe-utils.git -Source0: %{name}-%{version}.tar.gz +Source0: https://github.com/morbidrsa/fcoe-utils/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: quickstart.txt Source2: fcoe.service Source3: fcoe.config +Source4: README.redhat ExcludeArch: ppc s390 -Patch1: fcoe-utils-v1.0.30-1-fcoemon-Rework-daemonizing-and-error-handling.patch -Patch2: fcoe-utils-v1.0.30-2-fcoemon-fix-IEEE-state-machine.patch +Patch1: fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch +Patch2: fcoe-utils-v1.0.31-2-fcoeadm-Fix-possible-buffer-overflows.patch Patch3: fcoe-utils-v1.0.30-3-sanmac-isn-t-required.patch -Patch4: fcoe-utils-v1.0.30-fcoeadm-fix-display-when-some-netdevs-don-t-have-ser.patch BuildRequires: autoconf BuildRequires: automake -BuildRequires: libhbaapi-devel >= 2.2.9-6 -BuildRequires: libhbalinux-devel >= 1.0.17-1 +BuildRequires: libpciaccess-devel +#BuildRequires: libhbaapi-devel >= 2.2.9-6 +#BuildRequires: libhbalinux-devel >= 1.0.17-1 BuildRequires: libtool BuildRequires: lldpad-devel >= 0.9.43 BuildRequires: systemd Requires: lldpad >= 0.9.43 -Requires: libhbalinux >= 1.0.16-4 +#Requires: libhbalinux >= 1.0.16-4 Requires: iproute Requires: device-mapper-multipath Requires(post): systemd @@ -44,6 +45,7 @@ fcoemon - service to configure DCB Ethernet QOS filters, works with lldpad %autosetup -p1 cp -v %{SOURCE1} quickstart.txt +cp -v %{SOURCE4} README.redhat %build ./bootstrap.sh @@ -81,7 +83,7 @@ sed -i -e 's/SUPPORTED_DRIVERS="libfc fcoe bnx2fc"/SUPPORTED_DRIVERS="libfc fcoe %systemd_postun_with_restart fcoe.service %files -%doc README COPYING QUICKSTART quickstart.txt +%doc README.redhat COPYING QUICKSTART quickstart.txt %{_sbindir}/* %{_mandir}/man8/* %{_unitdir}/fcoe.service @@ -92,7 +94,17 @@ sed -i -e 's/SUPPORTED_DRIVERS="libfc fcoe bnx2fc"/SUPPORTED_DRIVERS="libfc fcoe %{_libexecdir}/fcoe/ %changelog -* Mon Jul 06 2015 Chris Leech - 1.0.30-3.git%{?dist} +* Fri Aug 19 2016 Chris Leech - 1.0.31-1.git5dfd3e4 +- 1274530 rebase to upstream 1.0.31+ +- no longer requires libhbaapi/libhbalinux +- no longer attempts to connect to lldpad if DC_REQUIRED is configured off + for all interfaces + +* Wed Jul 06 2016 Chris Leech - 1.0.30-4.git91c0c8c +- 1039779 replace README that contained mostly build instructions with + README.redhat containing better distro-specific information + +* Mon Jul 06 2015 Chris Leech - 1.0.30-3.git91c0c8c - 1056367 remove s390x from ExcludeArch * Mon Jul 06 2015 Chris Leech - 1.0.30-2.git91c0c8c