lldpad/open-lldp-ecp-allow-for-failure-to-create.patch
2021-01-26 16:53:16 +08:00

30 lines
849 B
Diff

From 488051ae0b88b8b77081fadff8154dbd4ddfd54c Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 26 Jan 2021 16:16:17 +0800
Subject: [PATCH] ecp-allow-for-failure-to-create.patch
---
qbg/ecp22.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qbg/ecp22.c b/qbg/ecp22.c
index 4640701..ba8f891 100644
--- a/qbg/ecp22.c
+++ b/qbg/ecp22.c
@@ -782,7 +782,11 @@ void ecp22_start(char *ifname)
ecp = find_ecpdata(ifname, eud);
if (!ecp)
ecp = ecp22_create(ifname, eud);
- ecp->max_retries = ECP22_MAX_RETRIES_DEFAULT;
+ if (!ecp) {
+ LLDPAD_DBG("%s:%s failed creating ECP22 instance\n", __func__, ifname);
+ return;
+ }
+ ecp->max_retries = ECP22_MAX_RETRIES_DEFAULT;
ecp->max_rte = ECP22_ACK_TIMER_DEFAULT;
LIST_INIT(&ecp->inuse.head);
ecp->inuse.last = 0;
--
2.23.0