Misleading documentation in Netlink(7) man page / doesn't match with Kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To whom it may concern,
I'd like to inform you about a bug in the Netlink(7) man page [0].

It describes struct nlmsgerr the following way:

struct nlmsgerr {
       int error;        /* Negative errno or 0 for acknowledgements */
       struct nlmsghdr msg;  /* Message header that caused the error */
};

but according to Kernel code [1] [2] [3] it actually should be:

struct nlmsgerr {
       int error;        /* Negative errno or 0 for acknowledgements */
       struct nlmsghdr msg;  /* Message header that caused the error */
       /*
        * followed by the message contents unless NETLINK_CAP_ACK was set
        * or the ACK indicates success (error == 0)
        * message length is aligned with NLMSG_ALIGN()
        */
       /*
        * followed by TLVs defined in enum nlmsgerr_attrs
        * if NETLINK_EXT_ACK was set
        */
};

This discrepancy led to errors implementing at least a Rust library which
made wrong assumptions about the returned value.


[0] https://man7.org/linux/man-pages/man7/netlink.7.html
[1] https://elixir.bootlin.com/linux/v5.11/source/include/uapi/linux/netlink.h#L112
[2] https://elixir.bootlin.com/linux/v5.11/source/net/netlink/af_netlink.c#L2416
[3] https://elixir.bootlin.com/linux/v5.11/source/net/netlink/af_netlink.c#L2440


Kind regards
--
Philipp Schuster



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux