Closed rossburton closed 2 years ago
No (easy) way for me to test...
Does this help:
--- a/src/xxxid_info.c
+++ b/src/xxxid_info.c
@@ -100,7 +100,7 @@ inline int get_family_id(int sock_fd) {
return 0;
rep_len=recv(sock_fd,&answ,sizeof answ,0);
- if (answ.n.nlmsg_type==NLMSG_ERROR||(rep_len<0)||!NLMSG_OK((&answ.n),rep_len))
+ if (answ.n.nlmsg_type==NLMSG_ERROR||(rep_len<0)||!NLMSG_OK((&answ.n),(unsigned)rep_len))
return 0;
na=(struct nlattr *)GENLMSG_DATA(&answ);
@@ -154,7 +154,7 @@ inline int nl_xxxid_info(pid_t tid,pid_t pid,struct xxxid_stats *stats) {
struct msgtemplate msg;
ssize_t rv=recv(nl_sock,&msg,sizeof msg,0);
- if (msg.n.nlmsg_type==NLMSG_ERROR||!NLMSG_OK((&msg.n),rv)) {
+ if (msg.n.nlmsg_type==NLMSG_ERROR||!NLMSG_OK((&msg.n),(unsigned)rv)) {
struct nlmsgerr *err=NLMSG_DATA(&msg);
if (err->error!=-ESRCH)
fprintf(stderr,"fatal reply error, %d\n",err->error);
The bigger problem with these checks is that they are not done in the proper order. Fixed, thanks for the hint!
When building with clang for 32-bit arm: