lldpad/lldpad-0.9.41-lldpad-dormantTimer-should-not-be-touched-by-modules.patch
2011-04-21 09:10:21 +02:00

61 lines
1.7 KiB
Diff

From 4ead297738c0c9963ebfea2fb57edebf46bb8bba Mon Sep 17 00:00:00 2001
From: John Fastabend <john.r.fastabend@intel.com>
Date: Wed, 6 Apr 2011 08:48:38 -0700
Subject: [PATCH 48/51] lldpad: dormantTimer should not be touched by modules
CEE-DCBX modules is decrementing the dormantTimer this is
incorrect because it has implications for other modules.
Specifically they are dependent on lldp_dcbx.c handling
the dormantTimer mechanism in a way that their module
expects.
This moves the dormant timer handling into agent.c
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Petr Sabata <psabata@redhat.com>
---
lldp/agent.c | 3 +++
lldp_dcbx.c | 3 ---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lldp/agent.c b/lldp/agent.c
index f5efdbe..2af8ce6 100644
--- a/lldp/agent.c
+++ b/lldp/agent.c
@@ -47,8 +47,11 @@ static void timer(void *eloop_data, void *user_ctx)
if (n->ops && n->ops->timer)
n->ops->timer(port);
}
+ if (port->timers.dormantDelay)
+ port->timers.dormantDelay--;
port = port->next;
};
+
/* Load new timer */
eloop_register_timeout(1, 0, timer, NULL, NULL);
}
diff --git a/lldp_dcbx.c b/lldp_dcbx.c
index 567f04e..3f6197b 100644
--- a/lldp_dcbx.c
+++ b/lldp_dcbx.c
@@ -79,8 +79,6 @@ static int dcbx_check_operstate(struct port *port)
if (!port->portEnabled || !port->timers.dormantDelay)
return 0;
- port->timers.dormantDelay--;
-
err = get_app(port->ifname, 0, &app_data);
if (err)
goto err_out;
@@ -101,7 +99,6 @@ static int dcbx_check_operstate(struct port *port)
__func__, port->ifname, port->timers.dormantDelay,
pfc_data.protocol.OperMode,
app_data.protocol.OperMode);
- port->timers.dormantDelay = 0;
set_operstate(port->ifname, IF_OPER_UP);
}
--
1.7.4.4