Skip to content

Commit

Permalink
Set link layer security when opening socket. (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tero Heinonen authored Aug 17, 2016
1 parent 36436c8 commit 70447c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/coap_connection_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ static internal_socket_t *int_socket_create(uint16_t listen_port, bool use_ephem
ns_dyn_mem_free(this);
return NULL;
}

socket_setsockopt(this->listen_socket, SOCKET_IPPROTO_IPV6, SOCKET_LINK_LAYER_SECURITY, &(const int8_t) {
bypassSec ? 0 : 1
}, sizeof(int8_t));

// XXX API for this? May want to get clever to do recommended first query = 1 hop, retries = whole PAN
socket_setsockopt(this->listen_socket, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_MULTICAST_HOPS, &(const int16_t) {
16
Expand Down

0 comments on commit 70447c3

Please sign in to comment.