[lldp-devel] [PATCH] ecp fix unintended retransmit of ecp messages

Thomas Richter tmricht at linux.vnet.ibm.com
Thu Feb 21 11:49:28 UTC 2013


The rework of the ecp protocol introduced an unintended
retransmit of all ecp messages even when the ecp message
was acknowledged. The ecp message sequence number was not
stored in the vsi-profile data and remained zero.
vsi-profile data has been resend and acknowledged many times.

This caused no functional issue, but an increased traffic
between llpdad and switch.

With this patch the previous behavior is restored.

Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
---
 lldp_ecp.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/lldp_ecp.c b/lldp_ecp.c
index db873fd..f21c619 100644
--- a/lldp_ecp.c
+++ b/lldp_ecp.c
@@ -256,6 +256,7 @@ static bool ecp_build_ECPDU(struct vdp_data *vd)
 	u32 fb_offset = 0;
 	struct packed_tlv *ptlv =  NULL;
 	struct vsi_profile *p;
+	int rc;
 
 	/* TODO: use LLDP group MAC addresses to support
 	 *	 S-channels/multichannel
@@ -296,16 +297,13 @@ static bool ecp_build_ECPDU(struct vdp_data *vd)
 			continue;
 		}
 
-		if (ptlv) {
-			if (!ecp_append(vd->ecp.tx.frame, &fb_offset,
-				       ptlv->tlv, ptlv->size))
-				ptlv = free_pkd_tlv(ptlv);
-				break;
-		}
-
-		p->seqnr = vd->ecp.lastSequence;
-
+		rc = ecp_append(vd->ecp.tx.frame, &fb_offset, ptlv->tlv,
+				ptlv->size);
 		ptlv = free_pkd_tlv(ptlv);
+		if (rc)
+			p->seqnr = vd->ecp.lastSequence;
+		else
+			break;
 	}
 	ecp_append(vd->ecp.tx.frame, &fb_offset, end_tlv, sizeof end_tlv);
 	vd->ecp.tx.frame_len = MAX(fb_offset, (unsigned)ETH_ZLEN);
-- 
1.7.1



More information about the lldp-devel mailing list