nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gn...@apache.org
Subject [incubator-nuttx-apps] 02/03: nshlib: use rtgenmsg for netlib_get_arptable/netlib_get_nbtable lik Linux
Date Fri, 10 Apr 2020 15:22:17 GMT
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 63157f3a4d1ac00ec91b815f0c1cdae00ba9bca6
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
AuthorDate: Thu Apr 9 08:14:55 2020 -0400

    nshlib: use rtgenmsg for netlib_get_arptable/netlib_get_nbtable lik Linux
    
    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
    Change-Id: I0b28eea6a70d0b5f6c5beef26f6624edfb3d6c86
---
 netutils/netlib/netlib_getarptab.c | 14 +++++++-------
 netutils/netlib/netlib_getnbtab.c  | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/netutils/netlib/netlib_getarptab.c b/netutils/netlib/netlib_getarptab.c
index 3385eef..1dbcf76 100644
--- a/netutils/netlib/netlib_getarptab.c
+++ b/netutils/netlib/netlib_getarptab.c
@@ -60,7 +60,7 @@
 struct netlib_sendto_request_s
 {
   struct nlmsghdr hdr;
-  struct ndmsg msg;
+  struct rtgenmsg gen;
 };
 
 struct netlib_recvfrom_response_s
@@ -158,12 +158,12 @@ ssize_t netlib_get_arptable(FAR struct arp_entry_s *arptab,
   thiseq = ++seqno;
 
   memset(&req, 0, sizeof(req));
-  req.hdr.nlmsg_len   = NLMSG_LENGTH(sizeof(struct ndmsg));
-  req.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
-  req.hdr.nlmsg_seq   = thiseq;
-  req.hdr.nlmsg_type  = RTM_GETNEIGH;
-  req.hdr.nlmsg_pid   = pid;
-  req.msg.ndm_family  = AF_INET;
+  req.hdr.nlmsg_len    = NLMSG_LENGTH(sizeof(struct rtgenmsg));
+  req.hdr.nlmsg_flags  = NLM_F_REQUEST | NLM_F_DUMP;
+  req.hdr.nlmsg_seq    = thiseq;
+  req.hdr.nlmsg_type   = RTM_GETNEIGH;
+  req.hdr.nlmsg_pid    = pid;
+  req.gen.rtgen_family = AF_INET;
 
   nsent = send(fd, &req, req.hdr.nlmsg_len, 0);
   if (nsent < 0)
diff --git a/netutils/netlib/netlib_getnbtab.c b/netutils/netlib/netlib_getnbtab.c
index bcbf8b4..a6c3c54 100644
--- a/netutils/netlib/netlib_getnbtab.c
+++ b/netutils/netlib/netlib_getnbtab.c
@@ -60,7 +60,7 @@
 struct netlib_sendto_request_s
 {
   struct nlmsghdr hdr;
-  struct ndmsg msg;
+  struct rtgenmsg gen;
 };
 
 struct netlib_recvfrom_response_s
@@ -159,12 +159,12 @@ ssize_t netlib_get_nbtable(FAR struct neighbor_entry_s *nbtab,
   thiseq = ++seqno;
 
   memset(&req, 0, sizeof(req));
-  req.hdr.nlmsg_len   = NLMSG_LENGTH(sizeof(struct ndmsg));
-  req.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
-  req.hdr.nlmsg_seq   = thiseq;
-  req.hdr.nlmsg_type  = RTM_GETNEIGH;
-  req.hdr.nlmsg_pid   = pid;
-  req.msg.ndm_family  = AF_INET6;
+  req.hdr.nlmsg_len    = NLMSG_LENGTH(sizeof(struct rtgenmsg));
+  req.hdr.nlmsg_flags  = NLM_F_REQUEST | NLM_F_DUMP;
+  req.hdr.nlmsg_seq    = thiseq;
+  req.hdr.nlmsg_type   = RTM_GETNEIGH;
+  req.hdr.nlmsg_pid    = pid;
+  req.gen.rtgen_family = AF_INET6;
 
   nsent = send(fd, &req, req.hdr.nlmsg_len, 0);
   if (nsent < 0)


Mime
View raw message