acassen / keepalived

Keepalived
https://www.keepalived.org
GNU General Public License v2.0
4k stars 737 forks source link

v1.2.19 fails to compile on RHEL6/CentOS6 due to missing ipv4_devconf declarations #215

Closed giovtorres closed 8 years ago

giovtorres commented 8 years ago

With libnl3 installed on CentOS6, the vrrp/vrrp_if_config.c file tries to use ipv4_devconf declarations not present in <linux/ip.h>. As a result, make produces the following errors:

gcc -I../include -I../../lib -g -O2 -I/usr/include/libnl3   -I/usr/include/libnl3    -I/usr/src/linux/include -I/usr/src/linux/include -Wall -Wunused -Wstrict-prototypes -D_KRNL_2_6_ -D_WITH_LVS_ -D_HAVE_IPVS_SYNCD_ -D_HAVE_VRRP_VMAC_ -D_WITHOUT_SNMP_ -D_HAVE_LIBNL3_  -c vrrp_if_config.c
vrrp_if_config.c: In function ‘netlink3_set_interface_parameters’:
vrrp_if_config.c:81: error: ‘IPV4_DEVCONF_ARP_IGNORE’ undeclared (first use in this function)
vrrp_if_config.c:81: error: (Each undeclared identifier is reported only once
vrrp_if_config.c:81: error: for each function it appears in.)
vrrp_if_config.c:82: error: ‘IPV4_DEVCONF_ACCEPT_LOCAL’ undeclared (first use in this function)
vrrp_if_config.c:83: error: ‘IPV4_DEVCONF_RP_FILTER’ undeclared (first use in this function)
vrrp_if_config.c:101: error: ‘IPV4_DEVCONF_ARPFILTER’ undeclared (first use in this function)
vrrp_if_config.c: In function ‘netlink3_reset_interface_parameters’:
vrrp_if_config.c:162: error: ‘IPV4_DEVCONF_ARP_IGNORE’ undeclared (first use in this function)
vrrp_if_config.c:163: error: ‘IPV4_DEVCONF_ARPFILTER’ undeclared (first use in this function)
make[2]: *** [vrrp_if_config.o] Error 1

The ipv4_devconf enum got introduced in the linux 3.11 kernel and doesn't exist in the 2.6.32 RHEL6/CentOS6 kernel headers.

Removing libnl3* packages and leaving libnl (version 1) installed on the system does allow the build to complete successfully, albeit with the _-DFALLBACKLIBNL1 compiler flag.

This will probably cause the .spec file not to build either if libnl3 is installed on an EL6 system. Seems like a check for kernel version might help during the configure step or somewhere else?

pqarmitage commented 8 years ago

Can this issue be closed now? This is resolved in commit f7bb0c2.