Re: [PATCH net-next v16 26/26] testing/selftests: add test tool and scripts for ovpn module

From: Antonio Quartulli
Date: Tue Dec 31 2024 - 02:42:27 EST


On 20/12/24 05:02, Jakub Kicinski wrote:
On Thu, 19 Dec 2024 02:42:20 +0100 Antonio Quartulli wrote:
+uint64_t nla_get_uint(struct nlattr *attr)
+{
+ if (nla_len(attr) == sizeof(uint32_t))
+ return nla_get_u32(attr);
+ else
+ return nla_get_u64(attr);
+}

Fedora 41 has: libnl3 3.11.0
which already defines nla_get_uint()

ovpn-cli.c:46:10: error: conflicting types for ‘nla_get_uint’; have ‘uint64_t(struct nlattr *)’ {aka ‘long unsigned int(struct nlattr *)’}
46 | uint64_t nla_get_uint(struct nlattr *attr)
| ^~~~~~~~~~~~
In file included from /usr/include/libnl3/netlink/msg.h:11,
from /usr/include/libnl3/netlink/genl/genl.h:10,
from ovpn-cli.c:26:
/usr/include/libnl3/netlink/attr.h:126:25: note: previous declaration of ‘nla_get_uint’ with type ‘uint64_t(const struct nlattr *)’ {aka ‘long unsigned int(const struct nlattr *)’}
126 | extern uint64_t nla_get_uint(const struct nlattr *);
| ^~~~~~~~~~~~

dang!
I guess I will just rename this function to avoid the clash for the time being.

Thanks.

Regards,

--
Antonio Quartulli
OpenVPN Inc.