aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/openlldp/files/0002-lldp_head-rename-and-make-extern.patch
blob: 8f65b799f0289ceca49cb8459c310cebb5447f11 (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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
From 07a83c583b9d508c7040dc6254a6a7113b2ce55f Mon Sep 17 00:00:00 2001
From: Aaron Conole <aconole@redhat.com>
Date: Mon, 3 Aug 2020 15:05:42 -0400
Subject: [PATCH 2/9] lldp_head: rename and make extern

Try to resolve this silly mod issue

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 config.c           |  4 ++--
 event_iface.c      |  4 ++--
 include/lldp_mod.h |  2 +-
 lldp/agent.c       |  2 +-
 lldp/rx.c          |  4 ++--
 lldp/tx.c          |  4 ++--
 lldp_dcbx.c        |  8 ++++----
 lldp_mand_cmds.c   |  8 ++++----
 lldpad.c           | 12 +++++++-----
 lldptool.c         | 14 ++++++++------
 lldptool_cmds.c    |  2 +-
 qbg/ecp22.c        |  8 ++++----
 qbg/vdp.c          |  4 ++--
 qbg/vdp22.c        |  6 +++---
 qbg/vdp22_cmds.c   |  2 +-
 vdptool.c          | 16 +++++++++-------
 16 files changed, 53 insertions(+), 47 deletions(-)

diff --git a/config.c b/config.c
index be458fd..bc3fbae 100644
--- a/config.c
+++ b/config.c
@@ -185,7 +185,7 @@ void scan_port(UNUSED void *eloop_data, UNUSED void *user_ctx)
 		LIST_FOREACH(agent, &port->agent_head, entry) {
 			LLDPAD_DBG("%s: calling ifdown for agent %p.\n",
 				   __func__, agent);
-			LIST_FOREACH(np, &lldp_head, lldp) {
+			LIST_FOREACH(np, &lldp_mod_head, lldp) {
 				ops = np->ops;
 				if (ops->lldp_mod_ifdown)
 					ops->lldp_mod_ifdown(ifname, agent);
@@ -394,7 +394,7 @@ void init_ports(void)
 		LIST_FOREACH(agent, &port->agent_head, entry) {
 			LLDPAD_DBG("%s: calling ifup for agent %p.\n",
 				   __func__, agent);
-			LIST_FOREACH(np, &lldp_head, lldp) {
+			LIST_FOREACH(np, &lldp_mod_head, lldp) {
 				if (np->ops->lldp_mod_ifup)
 					np->ops->lldp_mod_ifup(p->if_name, agent);
 			}
diff --git a/event_iface.c b/event_iface.c
index 43a95c7..1be2963 100644
--- a/event_iface.c
+++ b/event_iface.c
@@ -216,7 +216,7 @@ int oper_add_device(char *device_name)
 	LIST_FOREACH(agent, &port->agent_head, entry) {
 		LLDPAD_DBG("%s: calling ifup for agent %p.\n",
 			   __func__, agent);
-		LIST_FOREACH(np, &lldp_head, lldp) {
+		LIST_FOREACH(np, &lldp_mod_head, lldp) {
 			if (np->ops->lldp_mod_ifup)
 				np->ops->lldp_mod_ifup(device_name, agent);
 		}
@@ -283,7 +283,7 @@ static void event_if_decode_nlmsg(int route_type, void *data, int len)
 			LIST_FOREACH(agent, &port->agent_head, entry) {
 				LLDPAD_DBG("%s: calling ifdown for agent %p.\n",
 					   __func__, agent);
-				LIST_FOREACH(np, &lldp_head, lldp) {
+				LIST_FOREACH(np, &lldp_mod_head, lldp) {
 					ops = np->ops;
 					if (ops->lldp_mod_ifdown)
 						ops->lldp_mod_ifdown(device_name,
diff --git a/include/lldp_mod.h b/include/lldp_mod.h
index 49a50e4..9733595 100644
--- a/include/lldp_mod.h
+++ b/include/lldp_mod.h
@@ -96,7 +96,7 @@ struct lldp_module {
 };
 
 LIST_HEAD(lldp_head, lldp_module);
-struct lldp_head lldp_head;
+extern struct lldp_head lldp_mod_head;
 
 static inline struct lldp_module *find_module_by_id(struct lldp_head *head, int id)
 {
diff --git a/lldp/agent.c b/lldp/agent.c
index 333929a..aa4a8d1 100644
--- a/lldp/agent.c
+++ b/lldp/agent.c
@@ -163,7 +163,7 @@ static void timer(UNUSED void *eloop_data, UNUSED void *user_ctx)
 			run_rx_sm(port, agent);
 			update_rx_timers(agent);
 
-			LIST_FOREACH(n, &lldp_head, lldp) {
+			LIST_FOREACH(n, &lldp_mod_head, lldp) {
 				if (n->ops && n->ops->timer)
 					n->ops->timer(port, agent);
 			}
diff --git a/lldp/rx.c b/lldp/rx.c
index 12d07bc..43aeeba 100644
--- a/lldp/rx.c
+++ b/lldp/rx.c
@@ -359,7 +359,7 @@ void rxProcessFrame(struct port *port, struct lldp_agent *agent)
 		}
 
 		/* rx per lldp module */
-		LIST_FOREACH(np, &lldp_head, lldp) {
+		LIST_FOREACH(np, &lldp_mod_head, lldp) {
 			if (!np->ops || !np->ops->lldp_mod_rchange)
 				continue;
 
@@ -402,7 +402,7 @@ u8 mibDeleteObjects(struct port *port, struct lldp_agent *agent)
 {
 	struct lldp_module *np;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops || !np->ops->lldp_mod_mibdelete)
 			continue;
 		np->ops->lldp_mod_mibdelete(port, agent);
diff --git a/lldp/tx.c b/lldp/tx.c
index c3a5c62..0746e34 100644
--- a/lldp/tx.c
+++ b/lldp/tx.c
@@ -71,7 +71,7 @@ bool mibConstrInfoLLDPDU(struct port *port, struct lldp_agent *agent)
 	fb_offset += sizeof(struct l2_ethhdr);
 
 	/* Generic TLV Pack */
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops || !np->ops->lldp_mod_gettlv)
 			continue;
 
@@ -206,7 +206,7 @@ bool mibConstrShutdownLLDPDU(struct port *port, struct lldp_agent *agent)
 	memcpy(agent->tx.frameout, (void *)&eth, sizeof(struct l2_ethhdr));
 	fb_offset += sizeof(struct l2_ethhdr);
 
-	np = find_module_by_id(&lldp_head, LLDP_MOD_MAND);
+	np = find_module_by_id(&lldp_mod_head, LLDP_MOD_MAND);
 	if (!np)
 		goto error;
 	if (!np->ops || !np->ops->lldp_mod_gettlv)
diff --git a/lldp_dcbx.c b/lldp_dcbx.c
index 7e53c0f..809086f 100644
--- a/lldp_dcbx.c
+++ b/lldp_dcbx.c
@@ -129,7 +129,7 @@ struct dcbx_tlvs *dcbx_data(const char *ifname)
 	struct dcbd_user_data *dud;
 	struct dcbx_tlvs *tlv = NULL;
 
-	dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
+	dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX);
 	if (dud) {
 		LIST_FOREACH(tlv, &dud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
@@ -148,7 +148,7 @@ int dcbx_tlvs_rxed(const char *ifname, struct lldp_agent *agent)
 	if (agent->type != NEAREST_BRIDGE)
 		return 0;
 
-	dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
+	dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX);
 	if (dud) {
 		LIST_FOREACH(tlv, &dud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
@@ -172,7 +172,7 @@ int dcbx_check_active(const char *ifname)
 	struct dcbd_user_data *dud;
 	struct dcbx_tlvs *tlv = NULL;
 
-	dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
+	dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX);
 	if (dud) {
 		LIST_FOREACH(tlv, &dud->head, entry) {
 			if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
@@ -507,7 +507,7 @@ void dcbx_ifup(char *ifname, struct lldp_agent *agent)
 	ifindex = get_ifidx(ifname);
 	port = port_find_by_ifindex(ifindex);
 
-	dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
+	dud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_DCBX);
 	tlvs = dcbx_data(ifname);
 
 	if (!port)
diff --git a/lldp_mand_cmds.c b/lldp_mand_cmds.c
index 8a88177..1c43bf4 100644
--- a/lldp_mand_cmds.c
+++ b/lldp_mand_cmds.c
@@ -466,7 +466,7 @@ int handle_get_args(struct cmd *cmd, UNUSED char *arg, char *argvalue,
 	nbuf = obuf;
 	nbuf_len = obuf_len;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops->get_arg_handler)
 			continue;
 		if (!(ah = np->ops->get_arg_handler()))
@@ -496,7 +496,7 @@ int handle_get_arg(struct cmd *cmd, char *arg, char *argvalue,
 	struct arg_handlers *ah;
 	int rval, status = cmd_not_applicable;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops->get_arg_handler)
 			continue;
 		if (!(ah = np->ops->get_arg_handler()))
@@ -593,7 +593,7 @@ int handle_test_arg(struct cmd *cmd, char *arg, char *argvalue,
 	struct arg_handlers *ah;
 	int rval, status = cmd_not_applicable;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops->get_arg_handler)
 			continue;
 		if (!(ah = np->ops->get_arg_handler()))
@@ -626,7 +626,7 @@ int handle_set_arg(struct cmd *cmd, char *arg, char *argvalue,
 	struct arg_handlers *ah;
 	int rval, status = cmd_not_applicable;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (!np->ops->get_arg_handler)
 			continue;
 		if (!(ah = np->ops->get_arg_handler()))
diff --git a/lldpad.c b/lldpad.c
index 01fb588..65e92c7 100644
--- a/lldpad.c
+++ b/lldpad.c
@@ -80,6 +80,8 @@ struct lldp_module *(*register_tlv_table[])(void) = {
 	NULL,
 };
 
+struct lldp_head lldp_mod_head;
+
 char *cfg_file_name = NULL;
 bool daemonize = 0;
 int loglvl = LOG_WARNING;
@@ -98,7 +100,7 @@ static void init_modules(void)
 	struct lldp_module *premod = NULL;
 	int i = 0;
 
-	LIST_INIT(&lldp_head);
+	LIST_INIT(&lldp_mod_head);
 	for (i = 0; register_tlv_table[i]; i++) {
 		module = register_tlv_table[i]();
 		if (!module)
@@ -106,7 +108,7 @@ static void init_modules(void)
 		if (premod)
 			LIST_INSERT_AFTER(premod, module, lldp);
 		else
-			LIST_INSERT_HEAD(&lldp_head, module, lldp);
+			LIST_INSERT_HEAD(&lldp_mod_head, module, lldp);
 		premod = module;
 	}
 }
@@ -115,9 +117,9 @@ void deinit_modules(void)
 {
 	struct lldp_module *module;
 
-	while (lldp_head.lh_first != NULL) {
-		module = lldp_head.lh_first;
-		LIST_REMOVE(lldp_head.lh_first, lldp);
+	while (lldp_mod_head.lh_first != NULL) {
+		module = lldp_mod_head.lh_first;
+		LIST_REMOVE(lldp_mod_head.lh_first, lldp);
 		module->ops->lldp_mod_unregister(module);
 	}
 }
diff --git a/lldptool.c b/lldptool.c
index 2b14f61..664a248 100644
--- a/lldptool.c
+++ b/lldptool.c
@@ -64,6 +64,8 @@
 #include "lldp_util.h"
 #include "lldpad_status.h"
 
+struct lldp_head lldp_mod_head;
+
 static int show_raw;
 
 static const char *cli_version =
@@ -199,7 +201,7 @@ static void init_modules(void)
 		if (premod)
 			LIST_INSERT_AFTER(premod, module, lldp);
 		else
-			LIST_INSERT_HEAD(&lldp_head, module, lldp);
+			LIST_INSERT_HEAD(&lldp_mod_head, module, lldp);
 		premod = module;
 	}
 }
@@ -208,9 +210,9 @@ void deinit_modules(void)
 {
 	struct lldp_module *module;
 
-	while (lldp_head.lh_first != NULL) {
-		module = lldp_head.lh_first;
-		LIST_REMOVE(lldp_head.lh_first, lldp);
+	while (lldp_mod_head.lh_first != NULL) {
+		module = lldp_mod_head.lh_first;
+		LIST_REMOVE(lldp_mod_head.lh_first, lldp);
 		module->ops->lldp_mod_unregister(module);
 	}
 }
@@ -346,7 +348,7 @@ cli_cmd_help(UNUSED struct clif *clif, UNUSED int argc, UNUSED char *argv[],
 	printf("%s\n%s\n%s", commands_usage, commands_options, commands_help);
 
 	printf("\nTLV identifiers:\n");
-	LIST_FOREACH(np, &lldp_head, lldp)
+	LIST_FOREACH(np, &lldp_mod_head, lldp)
 		if (np->ops->print_help)
 			np->ops->print_help();
 	return 0;
@@ -406,7 +408,7 @@ u32 lookup_tlvid(char *tlvid_str)
 	struct lldp_module *np;
 	u32 tlvid = INVALID_TLVID;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (np->ops->lookup_tlv_name) {
 			tlvid = np->ops->lookup_tlv_name(tlvid_str);
 			if (tlvid != INVALID_TLVID)
diff --git a/lldptool_cmds.c b/lldptool_cmds.c
index daef8c8..70b7b0d 100644
--- a/lldptool_cmds.c
+++ b/lldptool_cmds.c
@@ -464,7 +464,7 @@ static void print_tlvs(struct cmd *cmd, char *ibuf)
 			offset += 8;
 		
 		printed = 0;
-		LIST_FOREACH(np, &lldp_head, lldp) {
+		LIST_FOREACH(np, &lldp_mod_head, lldp) {
 			if (np->ops->print_tlv(tlvid, tlv_len, ibuf+offset)) {
 					printed = 1;
 					break;
diff --git a/qbg/ecp22.c b/qbg/ecp22.c
index 6561d14..825392b 100644
--- a/qbg/ecp22.c
+++ b/qbg/ecp22.c
@@ -774,7 +774,7 @@ void ecp22_start(char *ifname)
 	struct ecp22 *ecp;
 
 	LLDPAD_DBG("%s:%s start ecp\n", __func__, ifname);
-	eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22);
+	eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22);
 	if (!eud) {
 		LLDPAD_DBG("%s:%s no ECP module\n", __func__, ifname);
 		return;
@@ -837,7 +837,7 @@ void ecp22_stop(char *ifname)
 	struct ecp22 *ecp;
 
 	LLDPAD_DBG("%s:%s stop ecp\n", __func__, ifname);
-	eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22);
+	eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22);
 	ecp = find_ecpdata(ifname, eud);
 	if (ecp)
 		ecp22_remove(ecp);
@@ -852,7 +852,7 @@ static int ecp22_data_from_evb(char *ifname, struct evb22_to_ecp22 *ptr)
 	struct ecp22_user_data *eud;
 	struct ecp22 *ecp;
 
-	eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22);
+	eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22);
 	ecp = find_ecpdata(ifname, eud);
 	if (ecp) {
 		ecp->max_rte = ptr->max_rte;
@@ -930,7 +930,7 @@ static int ecp22_req2send(char *ifname, unsigned short subtype,
 
 	LLDPAD_DBG("%s:%s subtype:%d\n", __func__, ifname, subtype);
 
-	eud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_ECP22);
+	eud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_ECP22);
 	ecp = find_ecpdata(ifname, eud);
 	if (!ecp) {
 		rc = -ENODEV;
diff --git a/qbg/vdp.c b/qbg/vdp.c
index d131560..c26bbd6 100644
--- a/qbg/vdp.c
+++ b/qbg/vdp.c
@@ -188,7 +188,7 @@ struct vdp_data *vdp_data(char *ifname)
 	struct vdp_user_data *ud;
 	struct vdp_data *vd = NULL;
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP02);
 	if (ud) {
 		LIST_FOREACH(vd, &ud->head, entry) {
 			if (!strncmp(ifname, vd->ifname, IFNAMSIZ))
@@ -1624,7 +1624,7 @@ void vdp_ifup(char *ifname, struct lldp_agent *agent)
 
 	LIST_INIT(&vd->profile_head);
 
-	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02);
+	ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP02);
 	LIST_INSERT_HEAD(&ud->head, vd, entry);
 
 out_start_again:
diff --git a/qbg/vdp22.c b/qbg/vdp22.c
index cf02310..81ea3a8 100644
--- a/qbg/vdp22.c
+++ b/qbg/vdp22.c
@@ -694,7 +694,7 @@ static struct vdp22 *vdp22_findif(const char *ifname,
 	struct vdp22 *vdp = 0;
 
 	if (!ud) {
-		ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22);
+		ud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22);
 		if (!ud)
 			LLDPAD_DBG("%s:%s no VDP22 module\n", __func__,
 				   ifname);
@@ -794,7 +794,7 @@ void vdp22_stop(char *ifname)
 	struct vsi22 *vsi;
 
 	LLDPAD_DBG("%s:%s stop vdp\n", __func__, ifname);
-	vud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22);
+	vud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22);
 	if (!vud) {
 		LLDPAD_ERR("%s:%s no VDP22 module\n", __func__, ifname);
 		return;
@@ -874,7 +874,7 @@ void vdp22_start(const char *ifname, int role)
 	struct vsi22 *vsi;
 
 	LLDPAD_DBG("%s:%s start vdp\n", __func__, ifname);
-	vud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP22);
+	vud = find_module_user_data_by_id(&lldp_mod_head, LLDP_MOD_VDP22);
 	if (!vud) {
 		LLDPAD_ERR("%s:%s no VDP22 module\n", __func__, ifname);
 		return;
diff --git a/qbg/vdp22_cmds.c b/qbg/vdp22_cmds.c
index 2e1bbbd..a8025ee 100644
--- a/qbg/vdp22_cmds.c
+++ b/qbg/vdp22_cmds.c
@@ -57,7 +57,7 @@ static struct lldp_module *get_my_module(int thisid)
 {
 	struct lldp_module *np = NULL;
 
-	LIST_FOREACH(np, &lldp_head, lldp)
+	LIST_FOREACH(np, &lldp_mod_head, lldp)
 		if (thisid == np->id)
 			break;
 	return np;
diff --git a/vdptool.c b/vdptool.c
index 8f36277..f1d946c 100644
--- a/vdptool.c
+++ b/vdptool.c
@@ -61,6 +61,8 @@
 #define OUI_ENCODE_HNDLR(name) name##_oui_encode_hndlr
 #define OUI_PRNT_DECODE_HNDLR(name) name##_oui_print_decode_hndlr
 
+struct lldp_head lldp_mod_head;
+
 #define EXTERN_OUI_FN(name) \
 	extern bool name##_oui_encode_hndlr(char *, char *, size_t); \
 	extern void name##_oui_print_decode_hndlr(char *)
@@ -796,13 +798,13 @@ static void init_modules(void)
 	struct lldp_module *premod = NULL;
 	int i = 0;
 
-	LIST_INIT(&lldp_head);
+	LIST_INIT(&lldp_mod_head);
 	for (i = 0; register_tlv_table[i]; i++) {
 		module = register_tlv_table[i]();
 		if (premod)
 			LIST_INSERT_AFTER(premod, module, lldp);
 		else
-			LIST_INSERT_HEAD(&lldp_head, module, lldp);
+			LIST_INSERT_HEAD(&lldp_mod_head, module, lldp);
 		premod = module;
 	}
 }
@@ -811,9 +813,9 @@ void deinit_modules(void)
 {
 	struct lldp_module *module;
 
-	while (lldp_head.lh_first != NULL) {
-		module = lldp_head.lh_first;
-		LIST_REMOVE(lldp_head.lh_first, lldp);
+	while (lldp_mod_head.lh_first != NULL) {
+		module = lldp_mod_head.lh_first;
+		LIST_REMOVE(lldp_mod_head.lh_first, lldp);
 		module->ops->lldp_mod_unregister(module);
 	}
 }
@@ -953,7 +955,7 @@ cli_cmd_help(UNUSED struct clif *clif, UNUSED int argc, UNUSED char *argv[],
 	printf("%s\n%s\n%s", commands_usage, commands_options, commands_help);
 
 	printf("\nTLV identifiers:\n");
-	LIST_FOREACH(np, &lldp_head, lldp)
+	LIST_FOREACH(np, &lldp_mod_head, lldp)
 		if (np->ops->print_help)
 			np->ops->print_help();
 	return 0;
@@ -1006,7 +1008,7 @@ u32 lookup_tlvid(char *tlvid_str)
 	struct lldp_module *np;
 	u32 tlvid = INVALID_TLVID;
 
-	LIST_FOREACH(np, &lldp_head, lldp) {
+	LIST_FOREACH(np, &lldp_mod_head, lldp) {
 		if (np->ops->lookup_tlv_name) {
 			tlvid = np->ops->lookup_tlv_name(tlvid_str);
 			if (tlvid != INVALID_TLVID)
-- 
2.28.0