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.
This commit is contained in:
Stuart Ianna 2023-06-27 12:50:22 +10:00 committed by Xiang Xiao
parent 037a6f5836
commit 30f8cf541c

View File

@ -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;