From 30f8cf541c135512281eca964288c1e19d5c1fa7 Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Tue, 27 Jun 2023 12:50:22 +1000 Subject: [PATCH] net/udp: Populate the udp connection structure with the address family. The udp connection structure contains the field, "domain", which defines which address family it belongs to. Prior to this change, this field was only populated correctly if IPv4 and IPv6 was enabled. As a result, packet information was not processed in udp_recvpktinfo, as expected when the appropriate socket option was enabled. --- net/udp/udp_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c index 63d716f224..b567789452 100644 --- a/net/udp/udp_conn.c +++ b/net/udp/udp_conn.c @@ -638,7 +638,7 @@ FAR struct udp_conn_s *udp_alloc(uint8_t domain) conn->sconn.ttl = IP_TTL_DEFAULT; conn->flags = 0; -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6) conn->domain = domain; #endif conn->lport = 0;