aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/openlldp/files/lldp_head-remove-all-references.patch
blob: bb3400cfa62425baaf27e85a20a82aa8b1413366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
From ed6a8e5a75f56b7034a46294a0bf2a9a7fd14fbc Mon Sep 17 00:00:00 2001
From: Aaron Conole <aconole@redhat.com>
Date: Fri, 23 Oct 2020 14:40:32 -0400
Subject: [PATCH] lldp_head: remove all references

There were a number of references missed during the module cleanup.  This hits the remaining
ones.

Fixes: 07a83c583b9d ("lldp_head: rename and make extern")
Signed-off-by: Aaron Conole <aconole@redhat.com>

Reference to upstream patch:
https://github.com/intel/openlldp/commit/ed6a8e5a75f56b7034a46294a0bf2a9a7fd14fbc

Signed-off-by: Li Wang <li.wang@windriver.com>
---
 ctrl_iface.c   |  4 +---
 lldp_8021qaz.c | 11 +++++------
 lldp_8023.c    |  6 ++----
 lldp_basman.c  |  6 ++----
 lldp_evb.c     |  6 ++----
 lldp_evb22.c   |  6 ++----
 lldp_mand.c    | 10 ++++------
 lldp_med.c     |  6 ++----
 qbg_utils.c    |  3 +--
 9 files changed, 21 insertions(+), 37 deletions(-)

diff --git a/ctrl_iface.c b/ctrl_iface.c
index 1734f49..666f7c8 100644
--- a/ctrl_iface.c
+++ b/ctrl_iface.c
@@ -53,8 +53,6 @@
 #include "lldp_util.h"
 #include "messages.h"
 
-extern struct lldp_head lldp_head;
-
 struct ctrl_dst {
 	struct ctrl_dst *next;
 	struct sockaddr_un addr;
@@ -116,7 +114,7 @@ int clif_iface_module(struct clif_data *clifd,
 		return cmd_invalid;
 	}
 
-	mod = find_module_by_id(&lldp_head, module_id);
+	mod = find_module_by_id(&lldp_mod_head, module_id);
 	if (mod && mod->ops && mod->ops->client_cmd)
 		return  (mod->ops->client_cmd)(clifd, from, fromlen,
 			 cmd_start, cmd_len, rbuf+strlen(rbuf), rlen);
diff --git a/lldp_8021qaz.c b/lldp_8021qaz.c
index 16ae167..e747710 100644
--- a/lldp_8021qaz.c
+++ b/lldp_8021qaz.c
@@ -48,7 +48,6 @@
 #include "lldp_dcbx.h"
 
 
-struct lldp_head lldp_head;
 extern config_t lldpad_cfg;
 extern bool read_only_8021qaz;
 
@@ -84,7 +83,7 @@ static int ieee8021qaz_check_pending(struct port *port,
 	if (!port->portEnabled)
 		return 0;
 
-	iud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8021QAZ);
+	iud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8021QAZ);
 	if (iud) {
 		LIST_FOREACH(tlv, &iud->head, entry) {
 			if (!strncmp(port->ifname, tlv->ifname, IFNAMSIZ)) {
@@ -143,7 +142,7 @@ struct ieee8021qaz_tlvs *ieee8021qaz_data(const char *ifname)
 	struct ieee8021qaz_user_data *iud;
 	struct ieee8021qaz_tlvs *tlv = NULL;
 
-	iud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8021QAZ);
+	iud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8021QAZ);
 	if (iud) {
 		LIST_FOREACH(tlv, &iud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
@@ -629,7 +628,7 @@ void ieee8021qaz_ifup(char *ifname, struct lldp_agent *agent)
 	LIST_INIT(&tlvs->app_head);
 	read_cfg_file(port->ifname, agent, tlvs);
 
-	iud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8021QAZ);
+	iud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8021QAZ);
 	LIST_INSERT_HEAD(&iud->head, tlvs, entry);
 
 initialized:
@@ -2179,7 +2178,7 @@ int ieee8021qaz_tlvs_rxed(const char *ifname)
 	struct ieee8021qaz_user_data *iud;
 	struct ieee8021qaz_tlvs *tlv = NULL;
 
-	iud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8021QAZ);
+	iud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8021QAZ);
 	if (iud) {
 		LIST_FOREACH(tlv, &iud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
@@ -2198,7 +2197,7 @@ int ieee8021qaz_check_active(const char *ifname)
 	struct ieee8021qaz_user_data *iud;
 	struct ieee8021qaz_tlvs *tlv = NULL;
 
-	iud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8021QAZ);
+	iud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8021QAZ);
 	if (iud) {
 		LIST_FOREACH(tlv, &iud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
diff --git a/lldp_8023.c b/lldp_8023.c
index 422026e..8a03211 100644
--- a/lldp_8023.c
+++ b/lldp_8023.c
@@ -39,8 +39,6 @@
 #include "lldp_8023_clif.h"
 #include "lldp_8023_cmds.h"
 
-extern struct lldp_head lldp_head;
-
 struct tlv_info_8023_maccfg {
 	u8 oui[3];
 	u8 sub;
@@ -84,7 +82,7 @@ static struct ieee8023_data *ieee8023_data(const char *ifname, enum agent_type t
 	struct ieee8023_user_data *ud;
 	struct ieee8023_data *bd = NULL;
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8023);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8023);
 	if (ud) {
 		LIST_FOREACH(bd, &ud->head, entry) {
 			if (!strncmp(ifname, bd->ifname, IFNAMSIZ) &&
@@ -456,7 +454,7 @@ void ieee8023_ifup(char *ifname, struct lldp_agent *agent)
 		goto out_err;
 	}
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8023);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_8023);
 	LIST_INSERT_HEAD(&ud->head, bd, entry);
 	LLDPAD_INFO("%s:port %s added\n", __func__, ifname);
 	return;
diff --git a/lldp_basman.c b/lldp_basman.c
index a4f69c1..614e2a2 100644
--- a/lldp_basman.c
+++ b/lldp_basman.c
@@ -75,8 +75,6 @@ struct tlv_info_manaddr {
 	struct tlv_info_maoid o;
 } __attribute__ ((__packed__));
 
-extern struct lldp_head lldp_head;
-
 static const struct lldp_mod_ops basman_ops =  {
 	.lldp_mod_register 	= basman_register,
 	.lldp_mod_unregister 	= basman_unregister,
@@ -91,7 +89,7 @@ static struct basman_data *basman_data(const char *ifname, enum agent_type type)
 	struct basman_user_data *bud;
 	struct basman_data *bd = NULL;
 
-	bud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_BASIC);
+	bud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_BASIC);
 	if (bud) {
 		LIST_FOREACH(bd, &bud->head, entry) {
 			if (!strncmp(ifname, bd->ifname, IFNAMSIZ) &&
@@ -688,7 +686,7 @@ void basman_ifup(char *ifname, struct lldp_agent *agent)
 		goto out_err;
 	}
 
-	bud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_BASIC);
+	bud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_BASIC);
 	LIST_INSERT_HEAD(&bud->head, bd, entry);
 	LLDPAD_DBG("%s:port %s added\n", __func__, ifname);
 	return;
diff --git a/lldp_evb.c b/lldp_evb.c
index dcdcc7e..a8f3965 100644
--- a/lldp_evb.c
+++ b/lldp_evb.c
@@ -36,14 +36,12 @@
 #include "messages.h"
 #include "config.h"
 
-extern struct lldp_head lldp_head;
-
 struct evb_data *evb_data(char *ifname, enum agent_type type)
 {
 	struct evb_user_data *ud;
 	struct evb_data *ed = NULL;
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_EVB);
 	if (ud) {
 		LIST_FOREACH(ed, &ud->head, entry) {
 			if (!strncmp(ifname, ed->ifname, IFNAMSIZ) &&
@@ -347,7 +345,7 @@ static void evb_ifup(char *ifname, struct lldp_agent *agent)
 
 	evb_init_tlv(ed, agent);
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_EVB);
 	LIST_INSERT_HEAD(&ud->head, ed, entry);
 	LLDPAD_DBG("%s:%s agent %d added\n", __func__, ifname, agent->type);
 }
diff --git a/lldp_evb22.c b/lldp_evb22.c
index 76ba883..6e92d9d 100644
--- a/lldp_evb22.c
+++ b/lldp_evb22.c
@@ -37,14 +37,12 @@
 #include "messages.h"
 #include "config.h"
 
-extern struct lldp_head lldp_head;
-
 struct evb22_data *evb22_data(char *ifname, enum agent_type type)
 {
 	struct evb22_user_data *ud;
 	struct evb22_data *ed = NULL;
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB22);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_EVB22);
 	if (ud) {
 		LIST_FOREACH(ed, &ud->head, entry) {
 			if (!strncmp(ifname, ed->ifname, IFNAMSIZ) &&
@@ -453,7 +451,7 @@ static void evb22_ifup(char *ifname, struct lldp_agent *agent)
 	STRNCPY_TERMINATED(ed->ifname, ifname, IFNAMSIZ);
 	ed->agenttype = agent->type;
 	evb22_init_tlv(ed, agent);
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB22);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_EVB22);
 	LIST_INSERT_HEAD(&ud->head, ed, entry);
 	LLDPAD_DBG("%s:%s agent %d added\n", __func__, ifname, agent->type);
 }
diff --git a/lldp_mand.c b/lldp_mand.c
index 0db63cb..b857a88 100644
--- a/lldp_mand.c
+++ b/lldp_mand.c
@@ -42,8 +42,6 @@
 #include "lldp/l2_packet.h"
 #include "lldp_tlv.h"
 
-extern struct lldp_head lldp_head;
-
 static const struct lldp_mod_ops mand_ops = {
 	.lldp_mod_register 	= mand_register,
 	.lldp_mod_unregister 	= mand_unregister,
@@ -59,7 +57,7 @@ struct mand_data *mand_data(const char *ifname, enum agent_type type)
 	struct mand_user_data *mud;
 	struct mand_data *md = NULL;
 
-	mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MAND);
+	mud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_MAND);
 	if (mud) {
 		LIST_FOREACH(md, &mud->head, entry) {
 			if (!strncmp(ifname, md->ifname, IFNAMSIZ) &&
@@ -608,7 +606,7 @@ void mand_ifup(char *ifname, struct lldp_agent *agent)
 		STRNCPY_TERMINATED(md->ifname, ifname, IFNAMSIZ);
 		md->agenttype = agent->type;
 
-		mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MAND);
+		mud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_MAND);
 		LIST_INSERT_HEAD(&mud->head, md, entry);
 	}
 
@@ -636,7 +634,7 @@ struct lldp_module *mand_register(void)
 		LLDPAD_ERR("failed to malloc LLDP Mandatory module data\n");
 		goto out_err;
 	}
-	mud = malloc(sizeof(struct mand_user_data));
+    mud = malloc(sizeof(struct mand_user_data));
 	if (!mud) {
 		free(mod);
 		LLDPAD_ERR("failed to malloc LLDP Mandatory module user data\n");
@@ -644,8 +642,8 @@ struct lldp_module *mand_register(void)
 	}
 	LIST_INIT(&mud->head);
  	mod->id = LLDP_MOD_MAND;
+    mod->data = mud;
 	mod->ops = &mand_ops;
-	mod->data = mud;
 	LLDPAD_INFO("%s:done\n", __func__);
 	return mod;
 out_err:
diff --git a/lldp_med.c b/lldp_med.c
index f6c373e..7b6996e 100644
--- a/lldp_med.c
+++ b/lldp_med.c
@@ -40,8 +40,6 @@
 #include "lldp_mand_clif.h"
 #include "lldp_med_cmds.h"
 
-extern struct lldp_head lldp_head;
-
 struct tlv_info_medcaps {
 	u8 oui[OUI_SIZE];
 	u8 subtype;
@@ -95,7 +93,7 @@ static struct med_data *med_data(const char *ifname, enum agent_type type)
 	struct med_user_data *mud;
 	struct med_data *md = NULL;
 
-	mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MED);
+	mud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_MED);
 	if (mud) {
 		LIST_FOREACH(md, &mud->head, entry) {
 			if (!strncmp(ifname, md->ifname, IFNAMSIZ) &&
@@ -914,7 +912,7 @@ void med_ifup(char *ifname, struct lldp_agent *agent)
 		free(md);
 		goto out_err;
 	}
-	mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MED);
+	mud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_MED);
 	LIST_INSERT_HEAD(&mud->head, md, entry);
 	LLDPAD_INFO("%s:port %s added\n", __func__, ifname);
 	return;
diff --git a/qbg_utils.c b/qbg_utils.c
index 9daeade..0d40c5b 100644
--- a/qbg_utils.c
+++ b/qbg_utils.c
@@ -36,7 +36,6 @@
 #include "qbg_utils.h"
 
 extern int loglvl;			/* Global lldpad log level */
-extern struct lldp_head lldp_head;
 
 /*
  * hexdump_frame - print raw evb/ecp/vdp frame
@@ -73,7 +72,7 @@ void hexdump_frame(const char *ifname, char *txt, const unsigned char *buf,
  */
 int modules_notify(int id, int sender_id, char *ifname, void *data)
 {
-	struct lldp_module *mp = find_module_by_id(&lldp_head, id);
+	struct lldp_module *mp = find_module_by_id(&lldp_mod_head, id);
 	int rc = 0;
 
 	if (mp && mp->ops->lldp_mod_notify)
-- 
2.18.1