Skip to content

Commit 70447c3

Browse files
author
Tero Heinonen
authored
Set link layer security when opening socket. (#30)
1 parent 36436c8 commit 70447c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/coap_connection_handler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ static internal_socket_t *int_socket_create(uint16_t listen_port, bool use_ephem
226226
ns_dyn_mem_free(this);
227227
return NULL;
228228
}
229+
230+
socket_setsockopt(this->listen_socket, SOCKET_IPPROTO_IPV6, SOCKET_LINK_LAYER_SECURITY, &(const int8_t) {
231+
bypassSec ? 0 : 1
232+
}, sizeof(int8_t));
233+
229234
// XXX API for this? May want to get clever to do recommended first query = 1 hop, retries = whole PAN
230235
socket_setsockopt(this->listen_socket, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_MULTICAST_HOPS, &(const int16_t) {
231236
16

0 commit comments

Comments
 (0)