[lldp-devel] [PATCH 1/8] vdp change module id

Thomas Richter tmricht at linux.vnet.ibm.com
Fri Apr 5 11:43:29 UTC 2013


Change module ID to match the same number as stored
in the type field in the lldp_vdp_cmds.c file

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

diff --git a/lldp_vdp.c b/lldp_vdp.c
index d71499c..ca746a9 100644
--- a/lldp_vdp.c
+++ b/lldp_vdp.c
@@ -47,6 +47,9 @@
 #include "lldp_qbg_utils.h"
 #include "lldp_mand_clif.h"
 
+/* Define Module id. Must match with value in lldp_vdp_clif.c */
+#define	LLDP_MOD_VDP02	((LLDP_MOD_VDP << 8) | LLDP_VDP_SUBTYPE)
+
 static const char * const vsi_responses[] = {
 	[VDP_RESPONSE_SUCCESS] = "success",
 	[VDP_RESPONSE_INVALID_FORMAT] = "invalid format",
@@ -185,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_VDP);
+	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02);
 	if (ud) {
 		LIST_FOREACH(vd, &ud->head, entry) {
 			if (!strncmp(ifname, vd->ifname, IFNAMSIZ))
@@ -1622,7 +1625,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_VDP);
+	ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP02);
 	LIST_INSERT_HEAD(&ud->head, vd, entry);
 
 out_start_again:
@@ -1687,7 +1690,7 @@ struct lldp_module *vdp_register(void)
 		return NULL;
 	}
 	LIST_INIT(&ud->head);
-	mod->id = LLDP_MOD_VDP;
+	mod->id = LLDP_MOD_VDP02;
 	mod->ops = &vdp_ops;
 	mod->data = ud;
 	LLDPAD_DBG("%s: done\n", __func__);
-- 
1.7.1



More information about the lldp-devel mailing list