[PATCH] Netlink on FreeBSD support

Ondrej Zajicek santiago at crfreenet.org
Fri Dec 16 19:59:01 CET 2022


On Thu, Dec 15, 2022 at 08:22:02PM +0000, Alexander Chernikov wrote:
> 
> A bit more patches (some bundled in net/bird already [1]).
> * 0001-FreeBSD-fix-netlink-build.patch  adds missed bsd-netlink Makefile, that actually builds the target

Hmm, seems like i forgot to add the Makefile from your previous patch,
but it didn't work properly anyways.

I do not like to redefine make rules like in this Makefile, seems to me
that the simplest solution is to put symlinks referencing linux/netlink*
to sysdep/bsd-netlink dir.

See https://gitlab.nic.cz/labs/bird/-/commit/7b6c9649775b288653b0d61df6004d79f0d83ccf


> * 0002-FreeBSD-use-interface-index-instead-of-IP-address-wh.patch switches multicast interface specification from ip address to interface index. That allows to avoid iface->sysdep value, which is not filled by netlink.

Nice. Is this supported since long ago, or does it require some recent BSD version?
Do you know whether it is supported also in other BSD flavors?

I just modified it to use feature-specific #define.

See https://gitlab.nic.cz/labs/bird/-/commit/6825f94570b05f933f09ae1bd7e520954d903e6a


> * 0003-netlink-move-OS-specific-headers-and-defines-to-sysd.patch introduces netlink OS-specific header to put all defines/includes/inlines

OK, moved netlink-sys.h to sysdep/bsd-netlink, that makes more sense to
me. If we later merge bsd-netlink to bsd under one target, we can move it
back.

Also removed netlink-nosup.h, it is not included anyways.

See https://gitlab.nic.cz/labs/bird/-/commit/176fc68aed32a5675aa643e3b7c6f65ff9ad13d0


Hopefully these changes are okay for you.


BTW, are BSD Netlink constants (e.g. RTA_*) the same as Linux ones?
Or it is just compatible on C macro/enum name level?

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


More information about the Bird-users mailing list