2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-13 14:07:02 +00:00

lldpd-structs: Fix type of c_id member.

This member is typically an Ethernet address so the appropriate type is
uint8_t, not char.  This eliminates a couple of casts.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2015-02-22 14:41:18 -08:00
parent 72c642e5ab
commit 1acaf4ac8f
4 changed files with 6 additions and 6 deletions

View File

@@ -344,7 +344,7 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
bool ttl_received = false;
int tlv_size, tlv_type, tlv_subtype;
u_int8_t *pos, *tlv;
char *b;
void *b;
struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map = NULL;
u_int8_t msg_auth_digest[LLDP_TLV_AA_ISID_VLAN_DIGEST_LENGTH];
struct lldpd_mgmt *mgmt;

View File

@@ -67,7 +67,7 @@ struct lldpd_chassis {
u_int16_t c_index; /* Monotonic index */
u_int8_t c_protocol; /* Protocol used to get this chassis */
u_int8_t c_id_subtype;
char *c_id;
uint8_t *c_id; /* Typically an Ethernet address. */
int c_id_len;
char *c_name;
char *c_descr;

View File

@@ -207,7 +207,7 @@ aa_print_element_status_port(struct ds *ds, struct lldpd_hardware *hw)
if (port->p_chassis) {
if (port->p_chassis->c_id_len > 0) {
chassisid_to_string((uint8_t *) port->p_chassis->c_id,
chassisid_to_string(port->p_chassis->c_id,
port->p_chassis->c_id_len, &id);
}
@@ -808,7 +808,7 @@ lldp_create(const struct netdev *netdev,
lchassis->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
lchassis->c_id_len = ETH_ADDR_LEN;
lchassis->c_id = xmalloc(ETH_ADDR_LEN);
netdev_get_etheraddr(netdev, (uint8_t *) lchassis->c_id);
netdev_get_etheraddr(netdev, lchassis->c_id);
list_init(&lchassis->c_mgmt);
lchassis->c_ttl = lldp->lldpd->g_config.c_tx_interval *

View File

@@ -26,7 +26,7 @@
#define ETH_TYPE_LLDP 0x88cc
/* Dummy MAC addresses */
static char chassis_mac[ETH_ADDR_LEN] = { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad };
static uint8_t chassis_mac[ETH_ADDR_LEN] = { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad };
static uint8_t eth_src[ETH_ADDR_LEN] = { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad };
/* LLDP multicast address */
@@ -61,7 +61,7 @@ check_received_chassis(struct lldpd_chassis *schassis,
{
assert(rchassis->c_id_subtype == schassis->c_id_subtype);
assert(rchassis->c_id_len == schassis->c_id_len);
assert(strncmp(rchassis->c_id, schassis->c_id, schassis->c_id_len) == 0);
assert(memcmp(rchassis->c_id, schassis->c_id, schassis->c_id_len) == 0);
assert(strcmp(rchassis->c_name, schassis->c_name) == 0);
assert(strcmp(rchassis->c_descr, schassis->c_descr) == 0);
assert(rchassis->c_cap_available == schassis->c_cap_available);