Skip to content

Commit

Permalink
Adjust variable scope (ARMmbed#121)
Browse files Browse the repository at this point in the history
Move ancillary_databuffer away from sub-block so that compiler does
not optimize the code away.
  • Loading branch information
Arto Kinnunen authored Mar 26, 2019
1 parent 227cc3d commit 086e7ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/coap_connection_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ static int send_to_real_socket(int8_t socket_id, const ns_address_t *address, co
.msg_iovlen = 1
};

uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))];

if (memcmp(source_address, ns_in6addr_any, 16)) {
uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))];
ns_cmsghdr_t *cmsg;
ns_in6_pktinfo_t *pktinfo;

Expand Down

0 comments on commit 086e7ba

Please sign in to comment.