1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-21 20:43:50 +01:00

grnc_sock_ip: implement SOCK_AUX_SET_LOCAL

This commit is contained in:
Benjamin Valentin 2022-05-09 23:33:19 +02:00
parent 6e1fb4c3aa
commit 2197f9c16a

View File

@ -223,6 +223,13 @@ ssize_t sock_ip_send_aux(sock_ip_t *sock, const void *data, size_t len,
}
memcpy(&local, &sock->local, sizeof(local));
}
#if IS_USED(MODULE_SOCK_AUX_LOCAL)
/* user supplied local endpoint takes precedent */
if ((aux != NULL) && (aux->flags & SOCK_AUX_SET_LOCAL)) {
local = aux->local;
aux->flags &= ~SOCK_AUX_SET_LOCAL;
}
#endif
if (remote == NULL) {
/* sock can't be NULL at this point */
memcpy(&rem, &sock->remote, sizeof(rem));