diff --git a/BUILDING b/BUILDING index 67deaafd..1e51afea 100644 --- a/BUILDING +++ b/BUILDING @@ -43,6 +43,10 @@ Some examples are:- # With TinyDTLS ./configure --enable-tests --disable-documentation --enable-examples --with-tinydtls --disable-shared +Note: FreeBSD requires gmake instead of make when building TinyDTLS - i.e. +gmake +sudo gmake install + # With OpenSSL ./configure --with-openssl --enable-tests --enable-shared diff --git a/src/coap_io.c b/src/coap_io.c index 91fcbb66..fd9e7907 100644 --- a/src/coap_io.c +++ b/src/coap_io.c @@ -798,6 +798,7 @@ coap_network_send(coap_socket_t *sock, const coap_session_t *session, const uint struct cmsghdr *cmsg; if (IN6_IS_ADDR_V4MAPPED(&session->local_addr.addr.sin6.sin6_addr)) { +#if defined(IP_PKTINFO) struct in_pktinfo *pktinfo; mhdr.msg_control = buf; mhdr.msg_controllen = CMSG_SPACE(sizeof(struct in_pktinfo)); @@ -811,6 +812,7 @@ coap_network_send(coap_socket_t *sock, const coap_session_t *session, const uint pktinfo->ipi_ifindex = session->ifindex; memcpy(&pktinfo->ipi_spec_dst, session->local_addr.addr.sin6.sin6_addr.s6_addr + 12, sizeof(pktinfo->ipi_spec_dst)); +#endif /* IP_PKTINFO */ } else { struct in6_pktinfo *pktinfo; mhdr.msg_control = buf; diff --git a/tests/test_session.c b/tests/test_session.c index 02af28a0..21b5419c 100644 --- a/tests/test_session.c +++ b/tests/test_session.c @@ -157,7 +157,7 @@ t_session6(void) { saddr.addr.sin6.sin6_addr = in6addr_loopback; saddr.addr.sin6.sin6_port = htons(20000); - session = coap_new_client_session(ctx, &laddr, &saddr, COAP_PROTO_UDP); + session = coap_new_client_session(ctx, &saddr, &laddr, COAP_PROTO_UDP); CU_ASSERT_PTR_NOT_NULL(session); CU_ASSERT_PTR_NOT_NULL(ctx->sessions); CU_ASSERT(session->state == COAP_SESSION_STATE_ESTABLISHED);