nshlib: use rtgenmsg for netlib_get_arptable/netlib_get_nbtable lik Linux
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I0b28eea6a70d0b5f6c5beef26f6624edfb3d6c86
This commit is contained in:
parent
300bc2729a
commit
63157f3a4d
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user