Server environment:
[Vagrant @ localhost download] $ uname-
Linux RS1 2.6.18-238. el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
[Vagrant @ localhost download] $ cat/etc/redhat-release
CentOS release 5.6 (Final)
[Vagrant @ localhost download] $
Ipvsadm version (the ipvsadm version corresponds to the Linux kernel ):
Ipvsadm-1.24
Compilation error:
[Vagrant @ localhost ipvsadm-1.24] $ make
Make-C libipvs
Make [1]: Entering directory '/home/vagrant/download/ipvsadm-1.24/libw.s'
Gcc-Wall-Wunused-Wstrict-prototypes-g-O2-I/usr/src/linux/include-DHAVE_NET_IP_VS_H-c-o libipvs. o libipvs. c
In file encoded ded from libipvs. c: 23:
Libipvs. h: 14: 23: error: net/ip_vs.h: No such file or directory
In file encoded ded from libipvs. c: 23:
Libipvs. h: 119: error: expected ') 'Before 'fwmark'
Libipvs. c: 27: error: field 'svc' has incomplete type
Libipvs. c: 28: error: field 'dest' has incomplete type
Libipvs. c: In function's S _ init ':
Libipvs. c: 40: error: invalid application of 'SIZE' to incomplete type 'struct ip_vs_getinfo'
Libipvs. c: 44: error: 'IP _ VS_SO_GET_INFO 'undeclared (first use in this function)
Libipvs. c: 44: error: (Each undeclared identifier is reported only once
Libipvs. c: 44: error: for each function it appears in .)
Libipvs. c: In function 'calls S _ getinfo ':
Libipvs. c: 56: error: invalid application of 'SIZE' to incomplete type 'struct ip_vs_getinfo'
Libipvs. c: 57: error: 'IP _ VS_SO_GET_INFO 'undeclared (first use in this function)
Libipvs. c: In function's S _ version ':
Libipvs. c: 64: error: invalid use of undefined type 'struct ip_vs_getinfo'
Libipvs. c: In function 'Seconds S _ flush ':
Libipvs. c: 70: error: 'IP _ VS_SO_SET_FLUSH 'undeclared (first use in this function)
Libipvs. c: In function's S _ add_service ':
Libipvs. c: 79: error: 'IP _ VS_SO_SET_ADD 'undeclared (first use in this function)
Libipvs. c: 79: error: dereferencing pointer to incomplete type
Libipvs. c: In function's S _ update_service ':
Libipvs. c: 87: error: 'IP _ VS_SO_SET_EDIT 'undeclared (first use in this function)
Libipvs. c: 87: error: dereferencing pointer to incomplete type
Libipvs. c: In function 'codecs _ del_service ':
Libipvs. c: 95: error: 'IP _ VS_SO_SET_DEL 'undeclared (first use in this function)
Libipvs. c: 95: error: dereferencing pointer to incomplete type
Libipvs. c: In function's S _ zero_service ':
Libipvs. c: 103: error: 'IP _ VS_SO_SET_ZERO 'undeclared (first use in this function)
Libipvs. c: 103: error: dereferencing pointer to incomplete type
Libipvs. c: In function 'codecs _ add_dest ':
Libipvs. c: 109: error: dereferencing pointer to incomplete type
Libipvs. c: 109: error: dereferencing pointer to incomplete type
Libipvs. c: 112: error: 'IP _ VS_SO_SET_ADDDEST 'undeclared (first use in this function)
Libipvs. c: In function's S _ update_dest ':
Libipvs. c: 119: error: dereferencing pointer to incomplete type
Libipvs. c: 119: error: dereferencing pointer to incomplete type
Libipvs. c: 122: error: 'IP _ VS_SO_SET_EDITDEST 'undeclared (first use in this function)
Libipvs. c: In function 'codecs _ del_dest ':
Libipvs. c: 129: error: dereferencing pointer to incomplete type
Libipvs. c: 129: error: dereferencing pointer to incomplete type
Libipvs. c: 132: error: 'IP _ VS_SO_SET_DELDEST 'undeclared (first use in this function)
Libipvs. c: In function's S _ set_timeout ':
Libipvs. c: 140: error: 'IP _ VS_SO_SET_TIMEOUT 'undeclared (first use in this function)
Libipvs. c: 141: error: dereferencing pointer to incomplete type
Libipvs. c: In function's S _ start_daemon ':
Libipvs. c: 148: error: 'IP _ VS_SO_SET_STARTDAEMON 'undeclared (first use in this function)
Libipvs. c: 149: error: dereferencing pointer to incomplete type
Libipvs. c: In function's S _ stop_daemon ':
Libipvs. c: 156: error: 'IP _ VS_SO_SET_STOPDAEMON 'undeclared (first use in this function)
Libipvs. c: 157: error: dereferencing pointer to incomplete type
Libipvs. c: In function 'calls S _ get_services ':
Libipvs. c: 166: error: dereferencing pointer to incomplete type
Libipvs. c: 167: error: invalid application of 'SIZE' to incomplete type's S _ service_entry_t'
Libipvs. c: 167: error: invalid use of undefined type 'struct ip_vs_getinfo'
Libipvs. c: 172: error: dereferencing pointer to incomplete type
Libipvs. c: 172: error: invalid use of undefined type 'struct ip_vs_getinfo'
Libipvs. c: 174: error: 'IP _ VS_SO_GET_SERVICES 'undeclared (first use in this function)
Libipvs. c: In function 'ipvs _ cmp_services ':
Libipvs. c: 189: error: dereferencing pointer to incomplete type
Libipvs. c: 189: error: dereferencing pointer to incomplete type
Libipvs. c: 193: error: dereferencing pointer to incomplete type
Libipvs. c: 193: error: dereferencing pointer to incomplete type
Libipvs. c: 197: error: dereferencing pointer to incomplete type
Libipvs. c: 197: error: dereferencing pointer to incomplete type
Libipvs. c: 201: error: dereferencing pointer to incomplete type
Libipvs. c: 201: error: dereferencing pointer to incomplete type
Libipvs. c: In function 'codecs _ sort_services ':
Libipvs. c: 208: error: dereferencing pointer to incomplete type
Libipvs. c: 208: error: dereferencing pointer to incomplete type
Libipvs. c: 209: error: invalid application of 'SIZE' to incomplete type's S _ service_entry_t'
Libipvs. c: In function 'calls S _ get_dests ':
Libipvs. c: 218: error: dereferencing pointer to incomplete type
Libipvs. c: 218: error: invalid application of 'SIZE' to incomplete type 'codecs _ dest_entry_t'
Libipvs. c: 218: error: dereferencing pointer to incomplete type
Libipvs. c: 224: error: dereferencing pointer to incomplete type
Libipvs. c: 224: error: dereferencing pointer to incomplete type
Libipvs. c: 225: error: dereferencing pointer to incomplete type
Libipvs. c: 225: error: dereferencing pointer to incomplete type
Libipvs. c: 226: error: dereferencing pointer to incomplete type
Libipvs. c: 226: error: dereferencing pointer to incomplete type
Libipvs. c: 227: error: dereferencing pointer to incomplete type
Libipvs. c: 227: error: dereferencing pointer to incomplete type
Libipvs. c: 228: error: dereferencing pointer to incomplete type
Libipvs. c: 228: error: dereferencing pointer to incomplete type
Libipvs. c: 231: error: 'IP _ VS_SO_GET_DESTS 'undeclared (first use in this function)
Libipvs. c: In function 'ipvs _ cmp_dests ':
Libipvs. c: 243: error: dereferencing pointer to incomplete type
Libipvs. c: 243: error: dereferencing pointer to incomplete type
Libipvs. c: 247: error: dereferencing pointer to incomplete type
Libipvs. c: 247: error: dereferencing pointer to incomplete type
Libipvs. c: In function 'ipvs _ sort_dests ':
Libipvs. c: 253: error: dereferencing pointer to incomplete type
Libipvs. c: 253: error: dereferencing pointer to incomplete type
Libipvs. c: 254: error: invalid application of 'SIZE' to incomplete type 'codecs _ dest_entry_t'
Libipvs. c: At top level:
Libipvs. c: 259: error: expected ') 'Before 'fwmark'
Libipvs. c: In function's S _ get_timeout ':
Libipvs. c: 288: error: dereferencing pointer to incomplete type
Libipvs. c: 293: error: 'IP _ VS_SO_GET_TIMEOUT 'undeclared (first use in this function)
Libipvs. c: In function 'calls S _ get_daemon ':
Libipvs. c: 309: error: dereferencing pointer to incomplete type
Libipvs. c: 315: error: 'IP _ VS_SO_GET_DAEMON 'undeclared (first use in this function)
Libipvs. c: In function 'Seconds S _ strerror ':
Libipvs. c: 357: error: 'codecs _ get_service 'undeclared (first use in this function)
Make [1]: *** [libipvs. o] Error 1
Make [1]: Leaving directory '/home/vagrant/download/ipvsadm-1.24/libw.s'
Make: *** [libs] Error 2
Open Makefile and find
INCLUDE =-I/usr/src/linux/include-I...-I.
The path/usr/src/linux does not exist on the server.
A soft connection is required.
Go to the/usr/src directory
[Vagrant @ localhost src] $ pwd
/Usr/src
[Vagrant @ localhost src] $ ll
Total 20
Drwxr-xr-x 2 root 4096 Jan 26 2010 debug
Drwxr-xr-x 3 root 4096 Nov 21 2012 kernels
Lrwxrwxrwx 1 root 49 Nov 21 2012 vboxguest-4.2.0->/opt/VBoxGuestAdditions-4.2.0/src/vboxguest-4.2.0
Ln-s generates a soft connection.
[Vagrant @ localhost src] $ sudo ln-s/usr/src/kernels/2.6.18-238. el5-x86_64 // usr/src/linux
[Vagrant @ localhost src] $ ll
Total 24
Drwxr-xr-x 2 root 4096 Jan 26 2010 debug
Drwxr-xr-x 3 root 4096 Nov 21 2012 kernels
Lrwxrwxrwx 1 root 39 May 5 linux->/usr/src/kernels/2.6.18-238. el5-x86_64/
Lrwxrwxrwx 1 root 49 Nov 21 2012 vboxguest-4.2.0->/opt/VBoxGuestAdditions-4.2.0/src/vboxguest-4.2.0
Compile and install ipvsadm.