[lldp-devel] [PATCH] lldpad: do not set rx state from TX initialization

John Fastabend john.fastabend at gmail.com
Tue Nov 19 08:31:37 UTC 2013


When the TX state is initialized it was incorrectly putting the RX
state in a non-operational state. This resulted in the TLVs being
cleared.

If the admin status was RX only then each time the select loop fires
the TX state was initialized, clearing the RX state and free'ing any
queued up received PDUs. With this fix PDU queries work in RX-only
mode. This patch resolves the issue, the following should work
correctly:

# lldptool -L -i eth0 adminstatus=rx
# lldptool -t -i ethx -n
Chassis ID TLV
        MAC: 00:22:44:55:66:77
Port ID TLV
        MAC: 00:22:44:55:66:77
Time to Live TLV
        120
End of LLDPDU TLV

A follow up patch should abort the multiple initializations occuring
when tx mode is disabled.

Signed-off-by: John Fastabend <john.r.fastabend at intel.com>
---
 lldp/tx.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/lldp/tx.c b/lldp/tx.c
index 67933a7..69c1a1a 100644
--- a/lldp/tx.c
+++ b/lldp/tx.c
@@ -118,8 +118,6 @@ void txInitializeLLDP(struct lldp_agent *agent)
 	}
 
 	agent->tx.state  = TX_LLDP_INITIALIZE;
-	agent->rx.state = LLDP_WAIT_PORT_OPERATIONAL;
-
 	agent->tx.localChange = false;
 	agent->stats.statsFramesOutTotal = 0;
 	agent->timers.reinitDelay   = REINIT_DELAY;



More information about the lldp-devel mailing list