This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new cf8dacde9c2 netinet/in.h: Rename imr_interface to imr_address in
struct ip_mreqn.
cf8dacde9c2 is described below
commit cf8dacde9c2d64dcf0e7312f1e1fb98486270c27
Author: daichuan <[email protected]>
AuthorDate: Thu Dec 26 16:28:19 2024 +0800
netinet/in.h: Rename imr_interface to imr_address in struct ip_mreqn.
Rename imr_interface to imr_address in struct ip_mreqn to match the Linux
definition.
This ensures compatibility with standard socket APIs and existing Linux
applications.
Signed-off-by: daichuan <[email protected]>
---
include/netinet/in.h | 2 +-
net/inet/ipv4_setsockopt.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 33d35a7a1d8..9647922d662 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -287,7 +287,7 @@ struct ip_mreq
struct ip_mreqn
{
struct in_addr imr_multiaddr; /* IPv4 multicast address of group */
- struct in_addr imr_interface; /* Local IPv4 address of interface */
+ struct in_addr imr_address; /* Local IPv4 address of interface */
unsigned int imr_ifindex; /* Local interface index */
};
diff --git a/net/inet/ipv4_setsockopt.c b/net/inet/ipv4_setsockopt.c
index cd0a6bd97f6..ddc60352915 100644
--- a/net/inet/ipv4_setsockopt.c
+++ b/net/inet/ipv4_setsockopt.c
@@ -267,7 +267,7 @@ int ipv4_setsockopt(FAR struct socket *psock, int option,
{
if (net_ipv4addr_cmp(mreq.imr_multiaddr.s_addr, INADDR_ANY))
{
- conn->mreq.imr_interface.s_addr = 0;
+ conn->mreq.imr_address.s_addr = 0;
conn->mreq.imr_ifindex = 0;
ret = OK;
break;
@@ -299,7 +299,7 @@ int ipv4_setsockopt(FAR struct socket *psock, int option,
}
#endif
- conn->mreq.imr_interface.s_addr = mreq.imr_multiaddr.s_addr;
+ conn->mreq.imr_address.s_addr = mreq.imr_multiaddr.s_addr;
conn->mreq.imr_ifindex = mreq.imr_ifindex;
ret = OK;
break;