summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--isisd/isis_te.c4
-rw-r--r--isisd/isis_tlvs.h19
-rw-r--r--pceplib/pcep_msg_objects.c5
-rw-r--r--pceplib/pcep_msg_objects_encoding.c8
-rw-r--r--pceplib/pcep_socket_comm_loop.c2
-rw-r--r--pceplib/test/pcep_session_logic_states_test.c2
-rw-r--r--tests/bgpd/test_aspath.c2
-rw-r--r--tests/topotests/lib/micronet.py2
8 files changed, 13 insertions, 31 deletions
diff --git a/isisd/isis_te.c b/isisd/isis_te.c
index 1a1e0dc294..579ae6aaba 100644
--- a/isisd/isis_te.c
+++ b/isisd/isis_te.c
@@ -439,7 +439,7 @@ static struct ls_vertex *lsp_to_vertex(struct ls_ted *ted, struct isis_lsp *lsp)
SET_FLAG(lnode.flags, LS_NODE_ROUTER_ID6);
}
if (tlvs->hostname) {
- memcpy(&lnode.name, tlvs->hostname, MAX_NAME_LENGTH);
+ strlcpy(lnode.name, tlvs->hostname, MAX_NAME_LENGTH);
SET_FLAG(lnode.flags, LS_NODE_NAME);
}
if (tlvs->router_cap) {
@@ -909,7 +909,7 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric,
p.u.prefix6 = std->local6;
}
if (!std)
- p = *prefix;
+ prefix_copy(&p, prefix);
else
te_debug(" |- Adjust prefix %pFX with local address to: %pFX",
prefix, &p);
diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h
index 364e38aba1..157450dc6c 100644
--- a/isisd/isis_tlvs.h
+++ b/isisd/isis_tlvs.h
@@ -31,10 +31,8 @@
DECLARE_MTYPE(ISIS_SUBTLV);
struct lspdb_head;
-struct isis_subtlvs;
struct sr_prefix_cfg;
-struct isis_area_address;
struct isis_area_address {
struct isis_area_address *next;
@@ -45,7 +43,6 @@ struct isis_area_address {
#define ISIS_WIDE_METRIC_INFINITY 0xFFFFFE
#define ISIS_NARROW_METRIC_INFINITY 62
-struct isis_oldstyle_reach;
struct isis_oldstyle_reach {
struct isis_oldstyle_reach *next;
@@ -53,7 +50,6 @@ struct isis_oldstyle_reach {
uint8_t metric;
};
-struct isis_oldstyle_ip_reach;
struct isis_oldstyle_ip_reach {
struct isis_oldstyle_ip_reach *next;
@@ -61,7 +57,6 @@ struct isis_oldstyle_ip_reach {
struct prefix_ipv4 prefix;
};
-struct isis_lsp_entry;
struct isis_lsp_entry {
struct isis_lsp_entry *next;
@@ -73,8 +68,6 @@ struct isis_lsp_entry {
struct isis_lsp *lsp;
};
-struct isis_extended_reach;
-struct isis_ext_subtlvs;
struct isis_extended_reach {
struct isis_extended_reach *next;
@@ -84,7 +77,6 @@ struct isis_extended_reach {
struct isis_ext_subtlvs *subtlvs;
};
-struct isis_extended_ip_reach;
struct isis_extended_ip_reach {
struct isis_extended_ip_reach *next;
@@ -95,7 +87,6 @@ struct isis_extended_ip_reach {
struct isis_subtlvs *subtlvs;
};
-struct isis_ipv6_reach;
struct isis_ipv6_reach {
struct isis_ipv6_reach *next;
@@ -162,7 +153,6 @@ struct isis_sr_block {
#define ISIS_PREFIX_SID_VALUE 0x08
#define ISIS_PREFIX_SID_LOCAL 0x04
-struct isis_prefix_sid;
struct isis_prefix_sid {
struct isis_prefix_sid *next;
@@ -179,7 +169,6 @@ struct isis_prefix_sid {
#define EXT_SUBTLV_LINK_ADJ_SID_SFLG 0x08
#define EXT_SUBTLV_LINK_ADJ_SID_PFLG 0x04
-struct isis_adj_sid;
struct isis_adj_sid {
struct isis_adj_sid *next;
@@ -189,7 +178,6 @@ struct isis_adj_sid {
uint32_t sid;
};
-struct isis_lan_adj_sid;
struct isis_lan_adj_sid {
struct isis_lan_adj_sid *next;
@@ -230,33 +218,28 @@ struct isis_router_cap {
uint8_t msd;
};
-struct isis_item;
struct isis_item {
struct isis_item *next;
};
-struct isis_lan_neighbor;
struct isis_lan_neighbor {
struct isis_lan_neighbor *next;
uint8_t mac[6];
};
-struct isis_ipv4_address;
struct isis_ipv4_address {
struct isis_ipv4_address *next;
struct in_addr addr;
};
-struct isis_ipv6_address;
struct isis_ipv6_address {
struct isis_ipv6_address *next;
struct in6_addr addr;
};
-struct isis_mt_router_info;
struct isis_mt_router_info {
struct isis_mt_router_info *next;
@@ -265,7 +248,6 @@ struct isis_mt_router_info {
uint16_t mtid;
};
-struct isis_auth;
struct isis_auth {
struct isis_auth *next;
@@ -279,7 +261,6 @@ struct isis_auth {
size_t offset; /* Only valid after packing */
};
-struct isis_item_list;
struct isis_item_list {
struct isis_item *head;
struct isis_item **tail;
diff --git a/pceplib/pcep_msg_objects.c b/pceplib/pcep_msg_objects.c
index e253fcc540..ce41ee953f 100644
--- a/pceplib/pcep_msg_objects.c
+++ b/pceplib/pcep_msg_objects.c
@@ -674,8 +674,9 @@ pcep_obj_create_ro_subobj_sr_ipv4_node(bool loose_hop, bool sid_absent,
}
obj->nai_list = dll_initialize();
/* Since the IP has to be stored in the list, copy it so the caller
- * doesnt have any restrictions about the type of memory used externally
- * for the IP. This memory will be freed with the object is freed. */
+ * doesn't have any restrictions about the type of memory used
+ * externally for the IP. This memory will be freed with the object is
+ * freed. */
struct in_addr *ipv4_node_id_copy =
pceplib_malloc(PCEPLIB_MESSAGES, sizeof(struct in_addr));
ipv4_node_id_copy->s_addr = ipv4_node_id->s_addr;
diff --git a/pceplib/pcep_msg_objects_encoding.c b/pceplib/pcep_msg_objects_encoding.c
index 69420f8e7a..75eb112e2e 100644
--- a/pceplib/pcep_msg_objects_encoding.c
+++ b/pceplib/pcep_msg_objects_encoding.c
@@ -463,7 +463,7 @@ uint16_t pcep_encode_obj_bandwidth(struct pcep_object_header *hdr,
struct pcep_object_bandwidth *bandwidth =
(struct pcep_object_bandwidth *)hdr;
uint32_t *uint32_ptr = (uint32_t *)obj_body_buf;
- /* Seems like the compiler doesnt correctly copy the float, so memcpy()
+ /* Seems like the compiler doesn't correctly copy the float, so memcpy()
* it */
memcpy(uint32_ptr, &(bandwidth->bandwidth), sizeof(uint32_t));
*uint32_ptr = htonl(*uint32_ptr);
@@ -481,7 +481,7 @@ uint16_t pcep_encode_obj_metric(struct pcep_object_header *hdr,
| (metric->flag_b ? OBJECT_METRIC_FLAC_B : 0x00));
obj_body_buf[3] = metric->type;
uint32_t *uint32_ptr = (uint32_t *)(obj_body_buf + 4);
- /* Seems like the compiler doesnt correctly copy the float, so memcpy()
+ /* Seems like the compiler doesn't correctly copy the float, so memcpy()
* it */
memcpy(uint32_ptr, &(metric->value), sizeof(uint32_t));
*uint32_ptr = htonl(*uint32_ptr);
@@ -1206,7 +1206,7 @@ pcep_decode_obj_bandwidth(struct pcep_object_header *hdr,
hdr, sizeof(struct pcep_object_bandwidth));
uint32_t value = ntohl(*((uint32_t *)obj_buf));
- /* Seems like the compiler doesnt correctly copy to the float, so
+ /* Seems like the compiler doesn't correctly copy to the float, so
* memcpy() it */
memcpy(&obj->bandwidth, &value, sizeof(uint32_t));
@@ -1223,7 +1223,7 @@ pcep_decode_obj_metric(struct pcep_object_header *hdr, const uint8_t *obj_buf)
obj->flag_c = (obj_buf[2] & OBJECT_METRIC_FLAC_C);
obj->type = obj_buf[3];
uint32_t value = ntohl(*((uint32_t *)(obj_buf + 4)));
- /* Seems like the compiler doesnt correctly copy to the float, so
+ /* Seems like the compiler doesn't correctly copy to the float, so
* memcpy() it */
memcpy(&obj->value, &value, sizeof(uint32_t));
diff --git a/pceplib/pcep_socket_comm_loop.c b/pceplib/pcep_socket_comm_loop.c
index d9a6b9ae48..ed8037d074 100644
--- a/pceplib/pcep_socket_comm_loop.c
+++ b/pceplib/pcep_socket_comm_loop.c
@@ -354,7 +354,7 @@ void handle_writes(pcep_socket_comm_handle *socket_comm_handle)
if (comm_session->close_after_write == true) {
if (comm_session->message_queue->num_entries == 0) {
/* TODO check to make sure modifying the
- * write_list while iterating it doesnt cause
+ * write_list while iterating it doesn't cause
* problems. */
pcep_log(
LOG_DEBUG,
diff --git a/pceplib/test/pcep_session_logic_states_test.c b/pceplib/test/pcep_session_logic_states_test.c
index e967d74e48..17ddae669f 100644
--- a/pceplib/test/pcep_session_logic_states_test.c
+++ b/pceplib/test/pcep_session_logic_states_test.c
@@ -281,7 +281,7 @@ void test_handle_timer_event_open_keep_alive()
void test_handle_socket_comm_event_null_params()
{
- /* Verify it doesnt core dump */
+ /* Verify it doesn't core dump */
handle_socket_comm_event(NULL);
verify_socket_comm_times_called(0, 0, 0, 0, 0, 0, 0);
reset_mock_socket_comm_info();
diff --git a/tests/bgpd/test_aspath.c b/tests/bgpd/test_aspath.c
index 3cc9a63072..ef1fcf5cec 100644
--- a/tests/bgpd/test_aspath.c
+++ b/tests/bgpd/test_aspath.c
@@ -1012,7 +1012,7 @@ static int validate(struct aspath *as, const struct test_spec *sp)
fails++;
printf("firstas: %d, got %d\n", sp->first,
aspath_firstas_check(as, sp->first));
- printf("loop does: %d %d, doesnt: %d %d\n", sp->does_loop,
+ printf("loop does: %d %d, doesn't: %d %d\n", sp->does_loop,
aspath_loop_check(as, sp->does_loop), sp->doesnt_loop,
aspath_loop_check(as, sp->doesnt_loop));
printf("private check: %d %d\n", sp->private_as,
diff --git a/tests/topotests/lib/micronet.py b/tests/topotests/lib/micronet.py
index 59dd80ff7b..d7b680da18 100644
--- a/tests/topotests/lib/micronet.py
+++ b/tests/topotests/lib/micronet.py
@@ -266,7 +266,7 @@ class Commander(object): # pylint: disable=R0205
)
if raises:
# error = Exception("stderr: {}".format(stderr))
- # This annoyingly doesnt' show stderr when printed normally
+ # This annoyingly doesn't' show stderr when printed normally
error = subprocess.CalledProcessError(rc, actual_cmd)
error.stdout, error.stderr = stdout, stderr
raise error