summaryrefslogtreecommitdiff
path: root/lib/lldp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lldp')
-rw-r--r--lib/lldp/aa-structs.h2
-rw-r--r--lib/lldp/lldp-tlv.h4
-rw-r--r--lib/lldp/lldp.c4
-rw-r--r--lib/lldp/lldpd-structs.h2
-rw-r--r--lib/lldp/lldpd.c4
-rw-r--r--lib/lldp/lldpd.h4
6 files changed, 9 insertions, 11 deletions
diff --git a/lib/lldp/aa-structs.h b/lib/lldp/aa-structs.h
index 983c74c31..473031ef3 100644
--- a/lib/lldp/aa-structs.h
+++ b/lib/lldp/aa-structs.h
@@ -24,7 +24,7 @@
#include "list.h"
struct lldp_aa_element_system_id {
- uint8_t system_mac[6];
+ struct eth_addr system_mac;
uint16_t conn_type;
uint16_t rsvd;
uint8_t rsvd2[2];
diff --git a/lib/lldp/lldp-tlv.h b/lib/lldp/lldp-tlv.h
index 2b948281f..f54493d19 100644
--- a/lib/lldp/lldp-tlv.h
+++ b/lib/lldp/lldp-tlv.h
@@ -18,8 +18,8 @@
#ifndef _LLDP_TLV_H
#define _LLDP_TLV_H
-#define LLDP_MULTICAST_ADDR { \
- 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e \
+#define LLDP_MULTICAST_ADDR { \
+ { { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } } \
}
#define LLDP_TLV_END 0
diff --git a/lib/lldp/lldp.c b/lib/lldp/lldp.c
index 493c2ffa9..0340f676a 100644
--- a/lib/lldp/lldp.c
+++ b/lib/lldp/lldp.c
@@ -349,7 +349,7 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
{
struct lldpd_chassis *chassis;
struct lldpd_port *port;
- const char lldpaddr[] = LLDP_MULTICAST_ADDR;
+ const struct eth_addr lldpaddr = LLDP_MULTICAST_ADDR;
const char dot1[] = LLDP_TLV_ORG_DOT1;
const char dot3[] = LLDP_TLV_ORG_DOT3;
const char med[] = LLDP_TLV_ORG_MED;
@@ -384,7 +384,7 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
VLOG_WARN("too short frame received on %s", hardware->h_ifname);
goto malformed;
}
- if (PEEK_CMP(lldpaddr, ETH_ADDR_LEN) != 0) {
+ if (PEEK_CMP(&lldpaddr, ETH_ADDR_LEN) != 0) {
VLOG_INFO("frame not targeted at LLDP multicast address "
"received on %s", hardware->h_ifname);
goto malformed;
diff --git a/lib/lldp/lldpd-structs.h b/lib/lldp/lldpd-structs.h
index 59d239c3e..15e5ce8fa 100644
--- a/lib/lldp/lldpd-structs.h
+++ b/lib/lldp/lldpd-structs.h
@@ -182,7 +182,7 @@ struct lldpd_hardware {
* to 0. */
int h_ifindex; /* Interface index, used by SNMP */
char h_ifname[IFNAMSIZ]; /* Should be unique */
- u_int8_t h_lladdr[ETH_ADDR_LEN];
+ struct eth_addr h_lladdr;
u_int64_t h_tx_cnt;
u_int64_t h_rx_cnt;
diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index 71d3938d1..71f7e44b6 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -50,7 +50,7 @@ static struct protocol protos[] =
{ LLDPD_MODE_LLDP, 1, "LLDP", 'l', lldp_send, lldp_decode, NULL,
LLDP_MULTICAST_ADDR },
{ 0, 0, "any", ' ', NULL, NULL, NULL,
- { 0,0,0,0,0,0 } }
+ { { { 0,0,0,0,0,0 } } } }
};
void lldpd_assign_cfg_to_protocols(struct lldpd *cfg)
@@ -209,7 +209,7 @@ lldpd_guess_type(struct lldpd *cfg, char *frame, int s)
continue;
}
if (cfg->g_protocols[i].guess == NULL) {
- if (memcmp(frame, cfg->g_protocols[i].mac, ETH_ADDR_LEN) == 0) {
+ if (memcmp(frame, &cfg->g_protocols[i].mac, ETH_ADDR_LEN) == 0) {
VLOG_DBG("guessed protocol is %s (from MAC address)",
cfg->g_protocols[i].name);
return cfg->g_protocols[i].mode;
diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h
index 6bd4b055c..c295ab413 100644
--- a/lib/lldp/lldpd.h
+++ b/lib/lldp/lldpd.h
@@ -54,9 +54,7 @@ struct protocol {
int(*guess)(PROTO_GUESS_SIG); /* Can be NULL, use MAC address in this
* case
*/
- u_int8_t mac[ETH_ADDR_LEN]; /* Destination MAC address used by this
- * protocol
- */
+ struct eth_addr mac; /* Destination MAC address used by this protocol */
};
#define SMART_HIDDEN(port) (port->p_hidden_in)