Hi,
On 08/03/2022 15:29, Kristof Provost wrote:
It’s not really too relevant either way for FreeBSD, because the header
contains very little information. It’s mostly only the ioctl numbers. There are
no structures shared between the kernel and user land. Instead we use nvlists
(name/value pair serialisation).
Yeah, quite similar to the linux header actually - netlink is indeed a
list of attribute/value airs. The Linux header contains also the
attribute names (as they are encoded into an int and must not change
once defined).
Theoretically I’d prefer to use the OS header, but I can certainly see the
upside of not having that dependency. We’ll always have to do the runtime check
(dco_available()) anyway, so I can certainly live with that.
p.s. as a side note, the rest of the code contains some "code style" issues.
Nothing major, but wanted to mention it (we can discuss on IRC if you want).
I’m happy to fix that. Do you have a rough list of what’s wrong?
https://community.openvpn.net/openvpn/wiki/CodeStyle is the authoritative style
guide, right?
Correct. Not everything might be there, so feel free to ask for any
clarification on IRC. Your code is already pretty clean actually.
Some things I have seen:
- We tend to avoid "if (a == NULL)" (or "!= 0") in favor of just "if (a)";
- We avoid spaces after the cast operator;
- we always use brackets {} for one-line blocks;
Regards,
--
Antonio Quartulli
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel