fcoe-utils/0036-fipvlan-clean-up-state-machine-for-pfd_add.patch
Tomáš Chvátal 045f8440d4 Accepting request 234122 from home:hreinecke:branches:network:fcoe
- Start fcoemon in foreground from service file (bnc#873269)
  * Add 0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
- Fixup IEEE state machine
  * Add 0031-fcoemon-Fix-IEEE-state-machine.patch
- Fix fipvlan crash during booting (bnc#877275):
  * Add 0032-fipvlan-Fix-crash-in-create_and_start_vlan.patch
  * Add 0033-fipvlan-suppress-warning-interface-already-exists.patch
  * Add 0034-fipvlan-do-not-crash-on-empty-MAC-address-in-lookup_.patch
- Fixup warning messages during booting:
  * Add 0035-fipvlan-fixup-return-value-on-error.patch
  * Add 0036-fipvlan-clean-up-state-machine-for-pfd_add.patch

- Remove obsolete file fcoe.config from sources

OBS-URL: https://build.opensuse.org/request/show/234122
OBS-URL: https://build.opensuse.org/package/show/network:fcoe/fcoe-utils?expand=0&rev=18
2014-05-19 13:39:19 +00:00

68 lines
1.8 KiB
Diff

From b19353bfa3186334611109456b232e596335c15e Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 14 May 2014 16:01:10 +0200
Subject: fipvlan: clean up state machine for pfd_add
pfd_add just adds the fd to the internal list without any checking.
So use the 'fip_ready' flag to track this.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
fipvlan.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
index 3300c68..2211fd1 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -397,10 +397,17 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
/* already tracking, update operstate and return */
iff->running = running;
if (!iff->running) {
- pfd_remove(iff->ps);
+ if (iff->fip_ready) {
+ pfd_remove(iff->ps);
+ iff->fip_ready = false;
+ }
return;
}
- pfd_add(iff->ps);
+ if (iff->ps >= 0 && !iff->fip_ready) {
+ pfd_add(iff->ps);
+ iff->fip_ready = true;
+ }
+
if (!config.start)
return;
@@ -440,6 +447,7 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
iff->ifindex = ifm->ifi_index;
iff->running = running;
iff->fip_ready = false;
+ iff->ps = -1;
if (ifla[IFLA_LINK])
iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]);
else
@@ -827,7 +835,8 @@ static int probe_fip_interface(struct iff *iff)
if (iff->req_sent)
return 0;
- if (!iff->fip_ready) {
+ if (iff->ps < 0) {
+ iff->fip_ready = false;
iff->ps = fip_socket(iff->ifindex, FIP_NONE);
if (iff->ps < 0) {
FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
@@ -835,6 +844,8 @@ static int probe_fip_interface(struct iff *iff)
}
setsockopt(iff->ps, SOL_PACKET, PACKET_ORIGDEV,
&origdev, sizeof(origdev));
+ }
+ if (!iff->fip_ready) {
pfd_add(iff->ps);
iff->fip_ready = true;
}
--
1.7.12.4