Skip to content

Commit 086e7ba

Browse files
author
Arto Kinnunen
authored
Adjust variable scope (#121)
Move ancillary_databuffer away from sub-block so that compiler does not optimize the code away.
1 parent 227cc3d commit 086e7ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/coap_connection_handler.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ static int send_to_real_socket(int8_t socket_id, const ns_address_t *address, co
408408
.msg_iovlen = 1
409409
};
410410

411+
uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))];
412+
411413
if (memcmp(source_address, ns_in6addr_any, 16)) {
412-
uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))];
413414
ns_cmsghdr_t *cmsg;
414415
ns_in6_pktinfo_t *pktinfo;
415416

0 commit comments

Comments
 (0)