File lldpad-0.9.32-compile-fixes of Package lldpad

diff --git a/config.c b/config.c
index 67998a0..fb778c6 100644
--- a/config.c
+++ b/config.c
@@ -48,6 +48,7 @@
 #include "drv_cfg.h"
 #include "config.h"
 #include "clif_msgs.h"
+#include "eloop.h"
 #include "lldp/l2_packet.h"
 
 config_t lldpad_cfg;
@@ -559,7 +560,7 @@ int set_cfg(const char *ifname, char *path, void *value, int type)
  */
 int get_config_tlvfield(const char *ifname, u32 tlvid, const char *field, void *val, int type)
 {
-	int rc;
+	int rc = 0;
 	char path[256];
 
 	memset(path, 0, sizeof(path));
@@ -570,7 +571,6 @@ int get_config_tlvfield(const char *ifname, u32 tlvid, const char *field, void *
 		rc = EIO;
 		goto out_err;
 	}
-	rc = 0;
 
 out_err:
 	return rc;
@@ -582,7 +582,7 @@ int get_config_tlvfield_int(const char *ifname, u32 tlvid, const char *field, in
 	int rc;
 	long int val = (long int) *value;
 
-	get_config_tlvfield(ifname, tlvid, field, &val, CONFIG_TYPE_INT);
+	rc = get_config_tlvfield(ifname, tlvid, field, &val, CONFIG_TYPE_INT);
 	*value = (int) val;
 	return rc;
 }
diff --git a/dcb_protocol.c b/dcb_protocol.c
index 7305456..94b58cd 100644
--- a/dcb_protocol.c
+++ b/dcb_protocol.c
@@ -888,9 +888,6 @@ Exit:
 
 void remove_dcb_support(void)
 {
-	void *it_elm = NULL;
-	void *it_second = NULL;
-
 	while (feature_struct.lh_first != NULL)     /* Delete. */
 		features_erase(&feature_struct.lh_first);
 
@@ -1403,10 +1400,10 @@ boolean_t add_pg_defaults()
 boolean_t remove_pg_defaults()
 {
 	char   sTmp[MAX_DESCRIPTION_LEN];
-	void * itp = NULL;
+	pg_it  itpg;
 
 	snprintf(sTmp, MAX_DESCRIPTION_LEN, DEF_CFG_STORE);
-	pg_it itpg = pg_find(&pg, sTmp);
+	itpg = pg_find(&pg, sTmp);
 	if (itpg == NULL)
 		return FALSE;
 
@@ -1452,10 +1449,10 @@ boolean_t add_pfc_defaults()
 boolean_t remove_pfc_defaults()
 {
 	char   sTmp[MAX_DESCRIPTION_LEN];
-	void * itp = NULL;
+	pfc_it itpfc;
 
 	snprintf(sTmp, MAX_DESCRIPTION_LEN, DEF_CFG_STORE);
-	pfc_it itpfc = pfc_find(&pfc, sTmp);
+	itpfc = pfc_find(&pfc, sTmp);
 	if (itpfc == NULL) {
 		return FALSE;
 	}
@@ -1507,11 +1504,11 @@ boolean_t add_app_defaults(u32 subtype)
 boolean_t remove_app_defaults(u32 subtype)
 {
 	char   sTmp[MAX_DESCRIPTION_LEN];
-	void * itp = NULL;
+	app_it it;
 
 	snprintf(sTmp, MAX_DESCRIPTION_LEN, "%s",   /* Localization OK */
 			 DEF_CFG_STORE);
-	app_it it = apptlv_find(&apptlv, sTmp, subtype);
+	it = apptlv_find(&apptlv, sTmp, subtype);
 
 	if (it == NULL) {
 		return FALSE;
@@ -1555,11 +1552,11 @@ boolean_t add_llink_defaults(u32 subtype)
 boolean_t remove_llink_defaults(u32 subtype)
 {
 	char   sTmp[MAX_DESCRIPTION_LEN];
-	void * itp = NULL;
+	llink_it itllink;
 
 	snprintf(sTmp, MAX_DESCRIPTION_LEN, "%s",   /* Localization OK */
 			 DEF_CFG_STORE);
-	llink_it itllink = llink_find(&llink, sTmp, subtype);
+	itllink = llink_find(&llink, sTmp, subtype);
 	if (itllink == NULL) {
 		return FALSE;
 	}
diff --git a/drv_cfg.c b/drv_cfg.c
index d449e42..46383ec 100644
--- a/drv_cfg.c
+++ b/drv_cfg.c
@@ -38,6 +38,7 @@
 #include <linux/dcbnl.h>
 #include <errno.h>
 #include "lldpad.h"
+#include "lldp_rtnl.h"
 #include "dcb_driver_if_types.h"
 #include "dcb_driver_interface.h"
 #include "dcb_protocol.h"
diff --git a/include/lldp_rtnl.h b/include/lldp_rtnl.h
index 7b1f5c9..fc4c53d 100644
--- a/include/lldp_rtnl.h
+++ b/include/lldp_rtnl.h
@@ -25,8 +25,14 @@
 
 *******************************************************************************/
 
+#ifndef _LLDP_RTNL_H
 #define _LLDP_RTNL_H
+
+#include "dcb_protocol.h"
+
 typedef int rtnl_handler(struct nlmsghdr *nh, void *arg);
 
 int set_operstate(char *ifname, __u8 operstate);
 int set_linkmode(char *ifname, __u8 linkmode);
+
+#endif /* _LLDP_RTNL_H */
diff --git a/lldp/ports.h b/lldp/ports.h
index 51de561..898dec2 100644
--- a/lldp/ports.h
+++ b/lldp/ports.h
@@ -170,6 +170,7 @@ int set_port_hw_resetting(const char *ifname, int resetting);
 int get_port_hw_resetting(const char *ifname);
 void set_lldp_port_enable_state(const char *ifname, int enable);
 void set_lldp_port_admin(const char *ifname, int enable);
+void set_port_oper_delay(const char *ifname);
 
 int get_lldp_port_statistics(char *ifname, struct portstats *stats);
 
diff --git a/lldp_dcbx_cmds.c b/lldp_dcbx_cmds.c
index 714867b..151fab4 100644
--- a/lldp_dcbx_cmds.c
+++ b/lldp_dcbx_cmds.c
@@ -34,6 +34,7 @@
 #include "dcb_events.h"
 #include "lldp_mand_clif.h"
 #include "lldp_dcbx_cmds.h"
+#include "lldp_dcbx_cfg.h"
 #include "clif_msgs.h"
 #include "dcb_protocol.h"
 #include "lldp/ports.h"
@@ -98,7 +99,6 @@ static int get_arg_tlvtxenable(struct cmd *cmd, char *arg, char *argvalue,
 	case (OUI_CEE_DCBX << 8) | 2:
 		snprintf(arg_path, sizeof(arg_path), "%s%08x.%s",
 			 TLVID_PREFIX, cmd->tlvid, arg);
-		
 		if (get_config_setting(cmd->ifname, arg_path, (void *)&value,
 					CONFIG_TYPE_BOOL))
 			value = FALSE;
@@ -113,8 +113,8 @@ static int get_arg_tlvtxenable(struct cmd *cmd, char *arg, char *argvalue,
 		s = VAL_YES;
 	else
 		s = VAL_NO;
-	
-	sprintf(obuf, "%02x%s%04x%s", strlen(arg), arg, strlen(s), s);
+
+	sprintf(obuf, "%02x%s%04x%s", (int)strlen(arg), arg, (int)strlen(s), s);
 
 	return cmd_success;
 }
@@ -418,7 +418,6 @@ int dcbx_clif_cmd(void *data,
 	u8 subtype;
 	u8 plen;
 	char port_id[MAX_U8_BUF];
-	struct port *port;
 	pg_attribs pg_data;
 	pfc_attribs pfc_data;
 	app_attribs app_data;
@@ -439,7 +438,7 @@ int dcbx_clif_cmd(void *data,
 
 	if (ilen < DCB_PORT_OFF)
 		return dcb_invalid_cmd;
-	
+
 	if (ibuf[DCB_VER_OFF] != (CLIF_MSG_VERSION | 0x30)) {
 		printf("unsupported client interface message version %x\n",
 			ibuf[DCB_VER_OFF]);
diff --git a/lldp_mand.c b/lldp_mand.c
index 53ee621..2c11884 100644
--- a/lldp_mand.c
+++ b/lldp_mand.c
@@ -181,7 +181,7 @@ static int mand_bld_chassis_tlv(struct mand_data *md)
 	/* check for value in shared memory first */
 	if (lldpad_shm_get_msap(md->ifname, CHASSIS_ID_TLV, (char *)&chassis, &length))
 		goto bld_tlv;
-	
+
 	/* subtype may differ when LLDP-MED is enabled */
 	if (!is_tlv_txenabled(md->ifname, TLVID_MED(LLDP_MED_RESERVED)))
 		goto bld_config;
@@ -227,7 +227,6 @@ bld_macaddr:
 	}
 
 bld_netaddr:
-bld_ipv4:
 	/* uses ipv4 first */
 	if (!get_ipaddr(md->ifname, &chassis.id.na.ip.v4)) {
 		chassis.sub = CHASSIS_ID_NETWORK_ADDRESS; 
@@ -238,7 +237,7 @@ bld_ipv4:
 
 		goto bld_tlv;
 	}
-bld_ipv6:
+
 	/* ipv4 fails, get ipv6 */
 	if (!get_ipaddr6(md->ifname, &chassis.id.na.ip.v6)) {
 		chassis.sub = CHASSIS_ID_NETWORK_ADDRESS; 
@@ -249,7 +248,6 @@ bld_ipv6:
 		goto bld_tlv;
 	}
 
-bld_ifname:
 	/* use ifname */
 	chassis.sub = CHASSIS_ID_INTERFACE_NAME;
 	strncpy(chassis.id.ifname, md->ifname, IFNAMSIZ);
diff --git a/lldp_util.c b/lldp_util.c
index 13cbd62..9dd9671 100644
--- a/lldp_util.c
+++ b/lldp_util.c
@@ -983,7 +983,6 @@ int str2mac(const char *src, u8 *mac, size_t size)
 {
 	int i = 0;
 	int rc = -1;
-	const char *s = NULL;
 
 	if (size < 6)
 		goto out_err;
@@ -1005,11 +1004,12 @@ out_err:
 
 int str2addr(int domain, const char *src, void *dst, size_t size)
 {
-	if ((domain == AF_INET) || (domain == AF_INET6))
+	if ((domain == AF_INET) || (domain == AF_INET6)) {
 		if (1 == inet_pton(domain, src, dst))
 			return 0;
 		else
 			return -1;
+	}
 
 	if (domain == AF_UNSPEC)
 		return str2mac(src, (u8 *)dst, size);
@@ -1019,11 +1019,12 @@ int str2addr(int domain, const char *src, void *dst, size_t size)
 
 int addr2str(int domain, const void *src, char *dst, size_t size)
 {
-	if ((domain == AF_INET) || (domain == AF_INET6))
+	if ((domain == AF_INET) || (domain == AF_INET6)) {
 		if (inet_ntop(domain, src, dst, size))
 			return 0;
 		else
 			return -1;
+	}
 
 	if (domain == AF_UNSPEC)
 		return mac2str((u8 *)src, dst, size);
diff --git a/lldpad.c b/lldpad.c
index 3098ce1..250d808 100644
--- a/lldpad.c
+++ b/lldpad.c
@@ -147,7 +147,6 @@ int main(int argc, char *argv[])
 	char buf[32];
 	int shm_remove = 0;
 	int killme = 0;
-	int rval;
 	pid_t pid;
 	int cnt;
 
diff --git a/nltest.c b/nltest.c
index c7e5146..5d612b4 100644
--- a/nltest.c
+++ b/nltest.c
@@ -971,7 +971,6 @@ static int get_app_cfg(char *ifname, appgroup_attribs *app_data)
 	struct dcbmsg *d;
 	struct rtattr *rta_parent, *rta_child;
 	int rval = 0;
-	int i;
 	unsigned int seq;
 	__u8 idtype;
 	__u16 id;
@@ -1051,7 +1050,6 @@ int set_hw_app(char *ifname, appgroup_attribs *app_data)
 {
 	struct nlmsghdr *nlh;
 	struct rtattr *rta_parent, *rta_child;
-	int i;
 	int seq;
 
 	printf("set_hw_app: %s\n", ifname);