[PATCH 1/2] idiag: add a copy of linux/sock_diag.h

Thomas Haller thaller at redhat.com
Fri Oct 24 01:40:48 PDT 2014


On Thu, 2014-10-23 at 11:20 -0700, Cong Wang wrote:
> When we test idiag on 3.4 kernel, we always get ERANGE.
> This is because libnl has its own copy for SK_MEMINFO_*,
> which is actually newer than 3.4, where SK_MEMINFO_VARS
> is larger than kernel's.
> 
> We add a copy from latest kernel, so on older kernel
> libnl should still compile. Note, for kernel < 3.6
> we don't have SK_MEMINFO_BACKLOG, we have to relax
> the minlen.



Hi Cong,


do you mind if I split up your first commit in 3 parts?


Also, I think, that

+#if (SK_MEMINFO_VARS > SK_MEMINFO_OPTMEM + 1)
     nl_dump(p, "\tbacklog: %d\n",
               msg->idiag_skmeminfo[SK_MEMINFO_BACKLOG]);
+#endif

is wrong, because the preprocessor cannot see the enum values.
I would jost drop that.




For the second commit, note that include/netlink/netlink.h cannot
include the private kernel header file. Hence, idiagnl_msg_get_tcpinfo()
returns "struct tcp_info" as defined in <netinet/tcp.h>.

We cannot internally use a different definition from
include/linux-private/linux/tcp.h because then idiagnl_msg_get_tcpinfo()
would break if <netinet/tcp.h> happens to define anything different.

I think, we can just drop including the private header file.

How about: https://github.com/thom311/libnl/commit/congwang%
2Fidiag_fixes ?



Thanks
Thomas





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20141024/0e4d4c50/attachment.sig>


More information about the libnl mailing list