On Sunday 05 January 2014 09:59:52 Antonio Quartulli wrote:
@@ -528,7 +526,7 @@ static int resolve_mac_from_cache_open(int ai_family) if (ret < 0) goto outclose;
ret = send(socknl, &nlreq, nlreq.hdr.nlmsg_len, 0);
ret = send(socknl, req, len, 0); if (ret < 0) goto outclose;
out: @@ -538,6 +536,22 @@ outclose: return ret; }
+static int resolve_mac_from_cache_open(int ai_family) +{
struct {
struct nlmsghdr hdr;
struct ndmsg msg;
} nlreq;
memset(&nlreq, 0, sizeof(nlreq));
nlreq.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(nlreq.msg));
nlreq.hdr.nlmsg_type = RTM_GETNEIGH;
nlreq.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
nlreq.msg.ndm_family = ai_family;
return rtnl_open(&nlreq, sizeof(nlreq), NETLINK_ROUTE);
+}
Is 'sizeof(nlreq)' equal to 'nlreq.hdr.nlmsg_len' ? It seems not ...
Cheers, Marek