Set link layer security when opening socket. (#30)

pull/3240/head
Tero Heinonen 2016-08-17 14:30:36 +03:00 committed by GitHub
parent 36436c8959
commit 70447c3e35
1 changed files with 5 additions and 0 deletions

View File

@ -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