Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcoap: fix build with IPv4 #20933

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sys/net/application_layer/gcoap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define NO_IMMEDIATE_REPLY (-1)

/* End of the range to pick a random timeout */
#define TIMEOUT_RANGE_END ((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000 / 1000)

Check warning on line 56 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

/* Internal functions */
static void *_event_loop(void *arg);
Expand Down Expand Up @@ -399,7 +399,7 @@
/* but store the header to keep the token for Observe notifications */
memcpy(memo->msg.hdr_buf, hdr, sizeof(hdr));
/* no further retransmissions should be made and
gcoap_request_memo_get_hdr() has to know how to get the header for Observe notifications */

Check warning on line 402 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
memo->send_limit = GCOAP_SEND_LIMIT_NON;
}
}
Expand Down Expand Up @@ -958,11 +958,19 @@
memo_pdu->hdr = gcoap_request_memo_get_hdr(memo);

/* verbose debug to catch bugs with request/response matching */
#if SOCK_HAS_IPV4
DEBUG("Seeking memo for remote=%s, tkn=0x%02x%02x%02x%02x%02x%02x%02x%02x, tkl=%"PRIuSIZE"\n",

Check warning on line 962 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
ipv4_addr_to_str(_ipv6_addr_str, (ipv4_addr_t *)&remote->addr.ipv4,
IPV6_ADDR_MAX_STR_LEN),
token[0], token[1], token[2], token[3], token[4], token[5], token[6], token[7],
tkl);
#else
DEBUG("Seeking memo for remote=%s, tkn=0x%02x%02x%02x%02x%02x%02x%02x%02x, tkl=%"PRIuSIZE"\n",

Check warning on line 968 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
ipv6_addr_to_str(_ipv6_addr_str, (ipv6_addr_t *)&remote->addr.ipv6,
IPV6_ADDR_MAX_STR_LEN),
token[0], token[1], token[2], token[3], token[4], token[5], token[6], token[7],
tkl);
#endif

if (coap_get_token_len(memo_pdu) != tkl) {
DEBUG("Token length mismatch %u\n", coap_get_token_len(memo_pdu));
Expand All @@ -980,9 +988,15 @@
DEBUG("matching multicast response\n");
}
else {
#if SOCK_HAS_IPV4
DEBUG("Remote address mismatch %s\n",
ipv4_addr_to_str(_ipv6_addr_str, (ipv4_addr_t *)&memo->remote_ep.addr.ipv4,
IPV6_ADDR_MAX_STR_LEN));
#else
DEBUG("Remote address mismatch %s\n",
ipv6_addr_to_str(_ipv6_addr_str, (ipv6_addr_t *)&memo->remote_ep.addr.ipv6,
IPV6_ADDR_MAX_STR_LEN));
#endif
continue;
mguetschow marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down Expand Up @@ -1664,7 +1678,7 @@
const coap_resource_t *resource = last_resource;

while (listener) {
if ((resource = _match_resource_path_iterator(listener, resource, (const uint8_t *)uri_path))) {

Check warning on line 1681 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*last_listener = listener;
return resource;
}
Expand Down Expand Up @@ -2091,4 +2105,4 @@
event_post(&_queue, arg);
}

/** @} */

Check warning on line 2108 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

source file is too long
Loading