[PATCH] ell: Inclusion of netlink.h in genl.h because of recent changes

Aditya <[email protected]> Sat, 26 Oct 2024 18:01:32 +0700
Newsgroups dev.linux.lists.ell
Message-ID <CAL5LfdR_mL+LZ4APgLbWcptAvqnFvTJqgmE6Ryaj4gyquJYN3g@mail.gmail.com>
I have found out that because recent changes, compilation of mptcpd
will failed with the following errors :

In file included from path_manager.c:21:
/home/user/works/openwrt/staging_dir/target-x86_64_glibc_custom/usr/include/ell/genl.h:
In function 'l_genl_attr_next':
/home/user/works/openwrt/staging_dir/target-x86_64_glibc_custom/usr/include/ell/genl.h:98:16:
error: implicit declaration of function 'l_netlink_attr_next'; did you
mean 'l_genl_attr_next'? [-Wimplicit-function-declaration]
   98 |         return l_netlink_attr_next((struct l_netlink_attr *) attr,
      |                ^~~~~~~~~~~~~~~~~~~
      |                l_genl_attr_next
/home/user/works/openwrt/staging_dir/target-x86_64_glibc_custom/usr/include/ell/genl.h:
In function 'l_genl_attr_recurse':
/home/user/works/openwrt/staging_dir/target-x86_64_glibc_custom/usr/include/ell/genl.h:105:16:
error: implicit declaration of function 'l_netlink_attr_recurse'; did
you mean 'l_genl_attr_recurse'? [-Wimplicit-function-declaration]
  105 |         return l_netlink_attr_recurse((struct l_netlink_attr *) attr,
      |                ^~~~~~~~~~~~~~~~~~~~~~
      |                l_genl_attr_recurse

This is compilation for glibc and by using gcc 14.2.0, the solution is
fairly simple :

diff -Naur a/ell/genl.h b/ell/genl.h
--- a/ell/genl.h
+++ b/ell/genl.h
@@ -11,6 +11,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
+#include "netlink.h"

 #ifdef __cplusplus
 extern "C" {