Skip to content

Commit a080f18

Browse files
author
Juha Heiuskanen
committed
Added debug tarce for dropped unsecured and MPL packets.
1 parent 51cd564 commit a080f18

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

source/Common_Protocols/icmpv6.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,7 @@ buffer_t *icmpv6_up(buffer_t *buf)
11101110
|| (buf->options.type == ICMPV6_TYPE_INFO_RPL_CONTROL
11111111
&& (buf->options.code != ICMPV6_CODE_RPL_DIO
11121112
&& buf->options.code != ICMPV6_CODE_RPL_DIS))) {
1113+
tr_warn("Drop: ICMP EP unsecured packet");
11131114
goto drop;
11141115
}
11151116
}

source/Common_Protocols/ipv6.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ static buffer_t *ipv6_consider_forwarding_multicast_packet(buffer_t *buf, protoc
10731073
{
10741074
/* Security checks needed here before forwarding */
10751075
if (buf->options.ll_security_bypass_rx) {
1076+
tr_warn("Drop: unsecured at forwarding layer");
10761077
goto no_forward;
10771078
}
10781079

@@ -1272,6 +1273,7 @@ buffer_t *ipv6_forwarding_up(buffer_t *buf)
12721273
*/
12731274
if (buf->options.ll_security_bypass_rx) {
12741275
if (addr_ipv6_scope(buf->dst_sa.address, cur) != IPV6_SCOPE_LINK_LOCAL) {
1276+
tr_warn("Drop: unsecured not link local scope packet");
12751277
goto drop;
12761278
}
12771279
}
@@ -1416,6 +1418,7 @@ buffer_t *ipv6_forwarding_up(buffer_t *buf)
14161418
#endif
14171419
default: {
14181420
if (buf->options.ll_security_bypass_rx) {
1421+
tr_warn("Drop: unsecured by BAD Next header %u", *nh_ptr);
14191422
goto bad_nh;
14201423
}
14211424
buffer_socket_set(buf, socket_lookup_ipv6(*nh_ptr, &buf->dst_sa, &buf->src_sa, true));

source/MPL/mpl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ static mpl_buffered_message_t *mpl_buffer_create(buffer_t *buf, mpl_domain_t *do
406406
uint16_t ip_len = buffer_data_length(buf);
407407

408408
while (mpl_total_buffered + ip_len > MAX_BUFFERED_MESSAGES_SIZE) {
409+
tr_debug("MPL MAX buffered message size limit...free space");
409410
mpl_free_space();
410411
}
411412

@@ -427,6 +428,7 @@ static mpl_buffered_message_t *mpl_buffer_create(buffer_t *buf, mpl_domain_t *do
427428

428429
mpl_buffered_message_t *message = ns_dyn_mem_alloc(sizeof(mpl_buffered_message_t) + ip_len);
429430
if (!message) {
431+
tr_debug("No heap for new MPL message");
430432
return NULL;
431433
}
432434
memcpy(message->message, buffer_data_pointer(buf), ip_len);
@@ -475,6 +477,7 @@ static void mpl_buffer_transmit(mpl_domain_t *domain, mpl_buffered_message_t *me
475477
uint16_t ip_len = mpl_buffer_size(message);
476478
buffer_t *buf = buffer_get(ip_len);
477479
if (!buf) {
480+
tr_debug("No heap for MPL transmit");
478481
return;
479482
}
480483

@@ -939,6 +942,9 @@ bool mpl_forwarder_process_message(buffer_t *buf, mpl_domain_t *domain, bool see
939942
}
940943

941944
message = mpl_buffer_create(buf, domain, seed, sequence, hop_limit);
945+
if (!message) {
946+
tr_debug("MPL Buffer Craete fail");
947+
}
942948

943949
return true;
944950
}

0 commit comments

Comments
 (0)