diff -ruN ipvsadm-1.24/Makefile ipvsadm-1.24.backwards_compat/Makefile --- ipvsadm-1.24/Makefile 2004-10-28 00:53:07.000000000 +0900 +++ ipvsadm-1.24.backwards_compat/Makefile 2005-01-27 13:24:45.000000000 +0900 @@ -74,10 +75,15 @@ POPT_DEFINE = -DHAVE_POPT endif +# If defined then if the version of ipvs in the kernel is too old +# for ipvsadm 1.24, then instead of trying to execute ipvsadm.1.21, +# print a warning and soldier on +BACKWARDS_COMPET_DEFINE= -DNO_BACKWARDS_COMPAT + OBJS = ipvsadm.o config_stream.o dynamic_array.o LIBS = $(POPT_LIB) DEFINES = -DVERSION=\"$(VERSION)\" -DSCHEDULERS=\"$(SCHEDULERS)\" \ - $(POPT_DEFINE) + $(POPT_DEFINE) $(BACKWARDS_COMPET_DEFINE) DEFINES += $(shell if [ ! -f ../ip_vs.h ]; then \ echo "-DHAVE_NET_IP_VS_H"; fi;) diff -ruN ipvsadm-1.24/ipvsadm.c ipvsadm-1.24.backwards_compat/ipvsadm.c --- ipvsadm-1.24/ipvsadm.c 2004-01-10 18:39:03.000000000 +0900 +++ ipvsadm-1.24.backwards_compat/ipvsadm.c 2005-01-27 13:32:46.000000000 +0900 @@ -54,6 +54,7 @@ * processing options. * Alexandre Cassen : added ipvs_syncd SyncdID support to filter * incoming sync messages. + * Horms : Added backwards compatibility code * * * ippfvsadm - Port Fowarding & Virtual Server ADMinistration program @@ -301,9 +302,11 @@ static void list_daemon(void); static int modprobe_ipvs(void); -static void check_ipvs_version(void); +static void check_ipvs_version(char **argv); static int process_options(int argc, char **argv, int reading_stdin); +static void exec_old(char **argv); + int main(int argc, char **argv) { @@ -319,7 +322,7 @@ } /* warn the user if the IPVS version is out of date */ - check_ipvs_version(); + check_ipvs_version(argv); /* list the table if there is no other arguement */ if (argc == 1){ @@ -1393,13 +1396,14 @@ } -static void check_ipvs_version(void) +static void check_ipvs_version(char *argv[]) { /* verify the IPVS version */ if (ipvs_info.version < IPVS_VERSION(MINIMUM_IPVS_VERSION_MAJOR, MINIMUM_IPVS_VERSION_MINOR, MINIMUM_IPVS_VERSION_PATCH)) { + exec_old(argv); fprintf(stderr, "Warning: IPVS version missmatch: \n" " Kernel compiled with IPVS version %d.%d.%d\n" @@ -1896,3 +1900,46 @@ return (offset