fcoe-utils/0013-Fallback-to-default-MAC-address-for-FIP.patch
Hannes Reinecke 94ae7e973d Accepting request 408431 from home:hreinecke:branches:network:fcoe
- fcoemon cannot start FIP responder (bsc#988887)
  * 0010-fcoemon-fixup-log_nlmsg_error.patch
  * 0011-fcoemon-Add-debugging-message-for-recv.patch
  * 0012-fcoemon-Retry-fcm_link_getlink-on-EBUSY.patch
  * 0013-Fallback-to-default-MAC-address-for-FIP.patch
- Rediff patch
  * 0006-fipvlan-fixup-return-value-on-error.patch
- Rename patch
  * old: 0009-fcoemon-c-add-a-check-to-verify-if-dcbd-is-to-be-initialized-else-do-not-try-to-connect-to-dcbd-lldpad.patch
  * new: 0009-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch
- Fixup spec file to correctly refer to service_del_postun

- Don't activate DCB on adapters which do DCB in Hardware (bsc#985816)
  + 0009-fcoemon-c-add-a-check-to-verify-if-dcbd-is-to-be-initialized-else-do-not-try-to-connect-to-dcbd-lldpad.patch

- Update to version 1.0.31 (FATE#320515)
    + 0009-fcoe-utils-Add-sysfs_hba-to-to-fcoemon_utils.patch
    + 0010-fcoeadm-Use-internal-sysfs-based-hba-lib-for-informa.patch
    + 0011-fcoeadm-Use-internal-sysfs-lib-to-display-target-and.patch
    + 0012-fcoeadm-Use-internal-sysfs-lib-to-display-port-stati.patch
    + 0013-fcoeadm-Get-rid-of-some-includes.patch
    + 0014-fcoemon-Use-internal-sysfs_hba-library.patch
    + 0015-libutil-remove-definition-of-sa_hex_format.patch
    + 0016-fcping-Convert-fcping-to-internal-sysfs-based-implem.patch
    + 0017-configure.ac-Remove-libHBAAPIv2-and-libhbalinux2.patch
    + 0018-support-multiple-connections.patch
    + 0019-fcoeadm_display-Fix-display-of-NPIV-ports.patch

- Fix display of NPIV ports (bsc#951859)
  + 0019-fcoeadm_display-Fix-display-of-NPIV-ports.patch

OBS-URL: https://build.opensuse.org/request/show/408431
OBS-URL: https://build.opensuse.org/package/show/network:fcoe/fcoe-utils?expand=0&rev=27
2016-07-14 08:34:25 +00:00

107 lines
3.3 KiB
Diff

From f36193036751f88c6208e7f0feda36116978a1af Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 30 Jun 2016 07:48:38 +0200
Subject: Fallback to default MAC address for FIP
FIP is a normal ethernet protocol, and doesn't rely on DCB to
be active or supported. So we should default to the NIC MAC
if no SAN MAC is present.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
fcoemon.c | 4 ++--
fipvlan.c | 2 +-
include/fip.h | 2 +-
lib/fip.c | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index 32ba30c..1df3d82 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1057,7 +1057,7 @@ static int fcm_vlan_disc_socket(struct fcoe_port *p)
int fd;
int origdev = 1;
- fd = fip_socket(p->ifindex, FIP_NONE);
+ fd = fip_socket(p->ifindex, p->mac, FIP_NONE);
if (fd < 0) {
FCM_LOG_ERR(errno, "socket error");
return fd;
@@ -1496,7 +1496,7 @@ static void init_fip_vn2vn_responder(struct fcoe_port *p)
if (p->fip_responder_socket >= 0)
return;
- s = fip_socket(p->ifindex, FIP_ALL_VN2VN);
+ s = fip_socket(p->ifindex, p->mac, FIP_ALL_VN2VN);
if (s < 0) {
FCM_LOG_ERR(errno, "%s: Failed to get fip socket\n", p->ifname);
return;
diff --git a/fipvlan.c b/fipvlan.c
index 4acf3d1..3662885 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -824,7 +824,7 @@ static int probe_fip_interface(struct iff *iff)
if (iff->ps < 0) {
iff->fip_ready = false;
- iff->ps = fip_socket(iff->ifindex, FIP_NONE);
+ iff->ps = fip_socket(iff->ifindex, iff->mac_addr, FIP_NONE);
if (iff->ps < 0) {
FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
return 0;
diff --git a/include/fip.h b/include/fip.h
index 443d3c4..0b6385c 100644
--- a/include/fip.h
+++ b/include/fip.h
@@ -144,7 +144,7 @@ struct fip_tlv_vlan {
/* libutil / fip.c functionality */
-int fip_socket(int ifindex, enum fip_multi multi);
+int fip_socket(int ifindex, unsigned char *mac, enum fip_multi multi);
/* FIP message handler, passed into fip_recv */
typedef int fip_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg);
diff --git a/lib/fip.c b/lib/fip.c
index 6657b61..b7f687b 100644
--- a/lib/fip.c
+++ b/lib/fip.c
@@ -122,13 +122,13 @@ fip_socket_add_addr(int s, int ifindex, bool add, const __u8 *mac, bool multi)
* @ifindex: network interface index to send on
* @add: 1 to add 0 to del
*/
-static int fip_socket_sanmac(int s, int ifindex, int add)
+static int fip_socket_sanmac(int s, int ifindex, unsigned char *mac, int add)
{
unsigned char smac[ETHER_ADDR_LEN];
if (fip_get_sanmac(ifindex, smac)) {
FIP_LOG_DBG("%s: no sanmac, ifindex %d\n", __func__, ifindex);
- return -ENXIO;
+ memcpy(smac, mac, ETHER_ADDR_LEN);
}
return fip_socket_add_addr(s, ifindex, add, smac, false);
@@ -200,7 +200,7 @@ static void drain_socket(int s)
* @ifindex: ifindex of netdevice to bind to
* @multi: Indication of any multicast address to bind to
*/
-int fip_socket(int ifindex, enum fip_multi multi)
+int fip_socket(int ifindex, unsigned char *mac, enum fip_multi multi)
{
struct sockaddr_ll sa = {
.sll_family = AF_PACKET,
@@ -214,7 +214,7 @@ int fip_socket(int ifindex, enum fip_multi multi)
if (s < 0)
return s;
- rc = fip_socket_sanmac(s, ifindex, 1);
+ rc = fip_socket_sanmac(s, ifindex, mac, 1);
if (rc < 0) {
close(s);
return rc;
--
2.6.6