mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-17 18:43:50 +01:00
Merge pull request #18369 from miri64/examples/fix/dtls-echo-af
examples/dtls-echo: set address family for sessions
This commit is contained in:
commit
23d8e9c085
@ -121,6 +121,7 @@ static int dtls_handle_read(dtls_context_t *ctx)
|
|||||||
|
|
||||||
dtls_session_init(&session);
|
dtls_session_init(&session);
|
||||||
session.addr.port = remote.port;
|
session.addr.port = remote.port;
|
||||||
|
session.addr.family = AF_INET6;
|
||||||
if (remote.netif == SOCK_ADDR_ANY_NETIF) {
|
if (remote.netif == SOCK_ADDR_ANY_NETIF) {
|
||||||
session.ifindex = SOCK_ADDR_ANY_NETIF;
|
session.ifindex = SOCK_ADDR_ANY_NETIF;
|
||||||
}
|
}
|
||||||
@ -359,6 +360,7 @@ dtls_context_t *_init_dtls(sock_udp_t *sock, sock_udp_ep_t *local,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Second: We prepare the DTLS Session by means of ctx->app */
|
/* Second: We prepare the DTLS Session by means of ctx->app */
|
||||||
|
dst->addr.family = AF_INET6;
|
||||||
dst->addr.port = remote->port;
|
dst->addr.port = remote->port;
|
||||||
|
|
||||||
/* NOTE: remote.addr.ipv6 and dst->addr.ipv6 are different structures. */
|
/* NOTE: remote.addr.ipv6 and dst->addr.ipv6 are different structures. */
|
||||||
|
|||||||
@ -116,6 +116,7 @@ static int dtls_handle_read(dtls_context_t *ctx)
|
|||||||
/* (DTLS) session requires the remote peer address (IPv6:Port) and netif */
|
/* (DTLS) session requires the remote peer address (IPv6:Port) and netif */
|
||||||
dtls_session_init(&session);
|
dtls_session_init(&session);
|
||||||
session.addr.port = remote_peer->remote->port;
|
session.addr.port = remote_peer->remote->port;
|
||||||
|
session.addr.family = AF_INET6;
|
||||||
if (remote_peer->remote->netif == SOCK_ADDR_ANY_NETIF) {
|
if (remote_peer->remote->netif == SOCK_ADDR_ANY_NETIF) {
|
||||||
session.ifindex = SOCK_ADDR_ANY_NETIF;
|
session.ifindex = SOCK_ADDR_ANY_NETIF;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user