From b59b1169856b1730277fc9095cac87fd242aff3e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 7 Nov 2022 17:15:49 +0100 Subject: [PATCH] fixup! gnrc_sock_udp: accept response from any address if remote is multicast --- sys/include/net/sock.h | 4 ++-- sys/net/gnrc/sock/udp/gnrc_sock_udp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/include/net/sock.h b/sys/include/net/sock.h index 0d37b9ce84436..4acf9f36a267e 100644 --- a/sys/include/net/sock.h +++ b/sys/include/net/sock.h @@ -143,8 +143,8 @@ extern "C" { * @anchor net_sock_flags * @{ */ -#define SOCK_FLAGS_REUSE_EP (0x0001) /**< allow to reuse end point on bind */ -#define SOCK_FLAGS_BIND_REMOTE (0x0002) /**< restrict responses to remote address */ +#define SOCK_FLAGS_REUSE_EP (0x0001) /**< allow to reuse end point on bind */ +#define SOCK_FLAGS_CONNECT_REMOTE (0x0002) /**< restrict responses to remote address */ /** @} */ /** diff --git a/sys/net/gnrc/sock/udp/gnrc_sock_udp.c b/sys/net/gnrc/sock/udp/gnrc_sock_udp.c index 1a3a415d97f3e..10bea2721d043 100644 --- a/sys/net/gnrc/sock/udp/gnrc_sock_udp.c +++ b/sys/net/gnrc/sock/udp/gnrc_sock_udp.c @@ -140,7 +140,7 @@ int sock_udp_create(sock_udp_t *sock, const sock_udp_ep_t *local, /* only accept responses from the set remote */ if (!(ipv6_addr_is_multicast((ipv6_addr_t *)&remote->addr) || ipv6_addr_is_unspecified((ipv6_addr_t *)&remote->addr))) { - flags |= SOCK_FLAGS_BIND_REMOTE; + flags |= SOCK_FLAGS_CONNECT_REMOTE; } } if (local != NULL) { @@ -208,7 +208,7 @@ ssize_t sock_udp_recv_aux(sock_udp_t *sock, void *data, size_t max_len, static bool _remote_mismatch(const sock_udp_t *sock, const udp_hdr_t *hdr, const sock_ip_ep_t *remote) { - if ((sock->flags & SOCK_FLAGS_BIND_REMOTE) == 0) { + if ((sock->flags & SOCK_FLAGS_CONNECT_REMOTE) == 0) { return false; }