net/netlink: The NETLINK_ROUTE logic needs to return the first queued response and not attempt to match up reponses with requests. That is the Linux compatible way. Also, use queue.h functions for list management and fix an error in arp_snapshot().

This commit is contained in:
Gregory Nutt
2019-11-04 09:02:14 -06:00
parent 7153598124
commit 6d13705e93
4 changed files with 30 additions and 55 deletions
+2 -3
View File
@@ -97,7 +97,7 @@ struct nlroute_recvfrom_response_s
struct nlroute_recvfrom_rsplist_s
{
FAR struct netlink_reqdata_s *flink;
sq_entry_t flink;
struct nlroute_recvfrom_response_s payload;
};
@@ -234,14 +234,13 @@ ssize_t netlink_route_recvfrom(FAR struct socket *psock,
ssize_t ret;
DEBUGASSERT(psock != NULL && nlmsg != NULL &&
nlmsg->nlmsg_len >= sizeof(struct nlmsghdr) &&
len >= sizeof(struct nlmsghdr));
/* Find the response to this message */
net_lock();
entry = (FAR struct nlroute_recvfrom_rsplist_s *)
netlink_get_response(psock, nlmsg);
netlink_get_response(psock);
net_unlock();
if (entry == NULL)