On Fri, Jun 24, 2016 at 1:04 AM, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > On Thu, Jun 23, 2016 at 06:41:45PM +0700, Neutron Soutmun wrote: >> On Thu, Jun 23, 2016 at 5:37 PM, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: >> > On Thu, Jun 23, 2016 at 05:22:11PM +0700, Neutron Soutmun wrote: >> >> * Backports the patch "libnl: nla_put_net64():align on a 64-bit area" [1] >> >> by Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx> >> >> >> >> * Since the nla_put_net64() API has been changed, therefore, the >> >> ip_set_compat.h.in should provides the macro IPSET_NLA_PUT_NET64 that >> >> point to the nla_put_net64() with appropriate number of arguments. >> >> >> >> The build script should distinguish the API changes by detect for >> >> the existence of nla_put_64bit() function in include/net/netlink.h. >> >> This function was added in the same patches set and called by >> >> the nla_put_be64() that called by nla_put_net64() respectively. >> > >> > What are you specifically fixing with this? >> >> Sorry that the patch is not clear the point. >> This patch is on top of the ipset master branch, http://git.netfilter.org/ipset, >> which I face a problem to build the latest ipset kernel module against >> the linux-4.7~rc4-1~exp1 (Debian Experimental). >> >> Therefore, I have backported the patch from mainline and prepared the >> macro for backward compatible which >> the ipset kernel module could be compiled with earlier kernel version (< 4.7) > > What is exactly the compilation error you get? === 8< === /usr/src/linux-headers-4.7.0-rc4-common/include/net/netlink.h:883:59: note: declared here static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value, ^ In file included from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:458:0, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_counter.h:58:9: error: too few arguments to function ‘nla_put_net64’ nla_put_net64(skb, IPSET_ATTR_PACKETS, ^ === 8< === Please see the full attached build.log for more information. As the error mention above, in the /usr/src/linux-headers-4.7.0-rc4-common/include/net/netlink.h, the nla_put_net64()'s API has been changed, the "int padattr" is added as the fourth argument. Best regards, Neutron Soutmun
$ ./configure --with-kmod checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking how to create a pax tar archive... gnutar checking whether make supports nested variables... (cached) yes checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes checking whether a program can dlopen itself... yes checking whether a statically linked program can dlopen itself... no checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking what extension is used for runtime loadable modules... .so checking what variable specifies run-time module search path... LD_LIBRARY_PATH checking for the default library search path... /lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu checking for library containing dlopen... -ldl checking for dlerror... yes checking for shl_load... (cached) no checking for shl_load in -ldld... (cached) no checking for dld_link in -ldld... no checking for _ prefix in compiled symbols... no checking whether deplibs are loaded by dlopen... yes checking for argz.h... yes checking for error_t... yes checking for argz_add... yes checking for argz_append... yes checking for argz_count... yes checking for argz_create_sep... yes checking for argz_insert... yes checking for argz_next... yes checking for argz_stringify... yes checking if argz actually works... yes checking whether libtool supports -dlopen/-dlpreopen... yes checking for ltdl.h... yes checking whether lt_dlinterface_register is declared... yes checking for lt_dladvise_preload in -lltdl... yes checking where to find libltdl headers... checking where to find libltdl library... -lltdl checking for unistd.h... (cached) yes checking for dl.h... no checking for sys/dl.h... no checking for dld.h... no checking for mach-o/dyld.h... no checking for dirent.h... yes checking for closedir... yes checking for opendir... yes checking for readdir... yes checking for strlcat... no checking for strlcpy... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for grep that handles long lines and -e... (cached) /bin/grep checking for gawk... (cached) gawk checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking whether ln -s works... yes checking for libmnl... yes checking whether NLA_F_NESTED is declared... yes checking whether NLA_F_NET_BYTEORDER is declared... yes checking whether NLA_TYPE_MASK is declared... yes checking for union nf_inet_addr... yes checking for gethostbyname2... yes checking kernel source for struct xt_action_param... yes checking kernel source for vzalloc... yes checking kernel source for ether_addr_equal... yes checking kernel source for nla_put_be16... yes checking kernel source for nla_put_be64... yes checking kernel source for portid in nl_info... yes checking kernel source for netlink_dump_start args... 4 args checking kernel source for ns_capable... yes checking kernel source for nfnl_lock per subsys... yes checking kernel source for export.h... yes checking kernel source for ipv6_skip_exthdr args... 4 args checking kernel source for bool checkentry function prototype... no checking kernel source for old struct xt_target_param... no checking kernel source for id in struct pernet_operations... yes checking kernel source for user_ns in struct net... yes checking kernel source for rbtree_postorder_for_each_entry_safe... yes checking kernel source for kvfree... yes checking kernel source for struct net in struct xt_mtchk_param... yes checking kernel source for struct net in the change function of tcf_ematch_ops... yes checking kernel source for struct net in struct tcf_ematch... yes checking kernel source for list_last_entry... yes checking kernel source for list_next_entry... yes checking kernel source for ether_addr_copy... yes checking kernel source for nf_bridge_get_physindev... yes checking kernel source for nla_put_in_addr... yes checking kernel source for struct net in struct nfnl_callback... yes checking kernel source for EXPORT_SYMBOL_GPL in module.h... no checking kernel source for struct net_generic... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating include/libipset/Makefile config.status: creating lib/Makefile config.status: creating lib/libipset.pc config.status: creating src/Makefile config.status: creating utils/Makefile config.status: creating kernel/include/linux/netfilter/ipset/ip_set_compat.h config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands ipset userspace tool configuration: Dynamic module loading: disabled Static modules: ipset_bitmap_ip ipset_bitmap_ipmac ipset_bitmap_port ipset_hash_ip ipset_hash_ipmac ipset_hash_ipmark ipset_hash_ipport ipset_hash_ipportip ipset_hash_ipportnet ipset_hash_mac ipset_hash_net ipset_hash_netiface ipset_hash_netnet ipset_hash_netport ipset_hash_netportnet ipset_list_set Dynamic modules: $ make modules make -C /lib/modules/`uname -r`/build M=$PWD/kernel/net V= \ KCFLAGS="-DPACKAGE_VERSION=6.29" \ IP_SET_MAX=256 KDIR=$PWD/kernel modules make[1]: Entering directory '/usr/src/linux-headers-4.7.0-rc4-amd64' CC [M] /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.o In file included from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:458:0, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_counter.h: In function ‘ip_set_put_counter’: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_counter.h:56:9: error: too few arguments to function ‘nla_put_net64’ return nla_put_net64(skb, IPSET_ATTR_BYTES, ^ In file included from /usr/src/linux-headers-4.7.0-rc4-common/include/net/rtnetlink.h:5:0, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sch_generic.h:12, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/filter.h:18, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sock.h:64, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/tcp.h:22, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/ipv6.h:76, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:14, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /usr/src/linux-headers-4.7.0-rc4-common/include/net/netlink.h:883:59: note: declared here static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value, ^ In file included from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:458:0, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_counter.h:58:9: error: too few arguments to function ‘nla_put_net64’ nla_put_net64(skb, IPSET_ATTR_PACKETS, ^ In file included from /usr/src/linux-headers-4.7.0-rc4-common/include/net/rtnetlink.h:5:0, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sch_generic.h:12, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/filter.h:18, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sock.h:64, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/tcp.h:22, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/ipv6.h:76, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:14, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /usr/src/linux-headers-4.7.0-rc4-common/include/net/netlink.h:883:59: note: declared here static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value, ^ In file included from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:459:0, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h: In function ‘ip_set_put_skbinfo’: /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h:26:3: error: too few arguments to function ‘nla_put_net64’ nla_put_net64(skb, IPSET_ATTR_SKBMARK, ^ In file included from /usr/src/linux-headers-4.7.0-rc4-common/include/net/rtnetlink.h:5:0, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sch_generic.h:12, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/filter.h:18, from /usr/src/linux-headers-4.7.0-rc4-common/include/net/sock.h:64, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/tcp.h:22, from /usr/src/linux-headers-4.7.0-rc4-common/include/linux/ipv6.h:76, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/include/linux/netfilter/ipset/ip_set.h:14, from /home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.c:19: /usr/src/linux-headers-4.7.0-rc4-common/include/net/netlink.h:883:59: note: declared here static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value, ^ /usr/src/linux-headers-4.7.0-rc4-common/scripts/Makefile.build:300: recipe for target '/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.o' failed make[5]: *** [/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter/xt_set.o] Error 1 /usr/src/linux-headers-4.7.0-rc4-common/scripts/Makefile.build:445: recipe for target '/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter' failed make[4]: *** [/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net/netfilter] Error 2 /usr/src/linux-headers-4.7.0-rc4-common/Makefile:1472: recipe for target '_module_/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net' failed make[3]: *** [_module_/home/neutron/works/debian/mypkg/ipset/git/ipset/kernel/net] Error 2 Makefile:150: recipe for target 'sub-make' failed make[2]: *** [sub-make] Error 2 Makefile:8: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.7.0-rc4-amd64' Makefile:975: recipe for target 'modules' failed make: *** [modules] Error 2