aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-03-20ipvsadm: fix wrong (negative) FWMARK values in outputHEADmasterAlexander Petrovsky1-4/+4
This ipvsadm patch fixes wrong (negative) FWMARK values representation: # ipvsadm -L -f 2882430849 Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn FWM -1412536447 wlc -> abc.my.host.net. Tunnel 1 0 0 Signed-off-by: Alexander Petrovsky <askjuise@gmail.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-12-24Release: Version 1.31v1.31Jesper Dangaard Brouer2-2/+2
This release add support for configuring tunneling with GRE or GUE encapsulation. See manpage ipvsadm(8) for --tun-type and --tun-info, plus more specific --tun-xxxx options for adjustments. Plus some manpage adjustments. The related kernel side commits: - v5.3: 6aedd14b25db ("ipvs: strip gre tunnel headers from icmp errors") - v5.3: 6f7b841bc939 ("ipvs: allow tunneling with gre encapsulation") - v5.3: 29930e314da3 ("ipvs: add checksum support for gue encapsulation") - v5.3: 508f744c0de3 ("ipvs: strip udp tunnel headers from icmp errors") - v5.3: 2aa3c9f48bc2 ("ipvs: add function to find tunnels") - v5.2: 84c0d5e96f3a ("ipvs: allow tunneling with gue encapsulation") This release is based on the kernel.org git tree: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/ You can download the tarballs from: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ Git tree: git://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-12-05In ipvsadm(8) add using nft or an eBPF program to set a packet markQuentin Armitage1-3/+4
The ipvsadm(8) man page specified that a packet mark could be set using iptables. It is now also possible to set the packet mark using nft, and also via an eBPF program. Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-12-05Add --pe sip option in ipvsadm(8) man pageQuentin Armitage1-5/+9
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-07-02ipvsadm: allow tunneling with gre encapsulationJulian Anastasov3-6/+34
Add support for real server tunnels with GRE encapsulation: --tun-type gre [--tun-nocsum|--tun-csum] Co-developed-by: Vadim Fedorenko <vfedorenko@yandex-team.ru> Signed-off-by: Vadim Fedorenko <vfedorenko@yandex-team.ru> Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-07-02Merge branch 'GUE-encap'Jesper Dangaard Brouer4-66/+473
Jacky Hu says: ============== This patchset allows tunneling with gue encapsulation. v8->v7: 1) fixed a few style issues from scripts/checkpatch.pl --strict 2) use up to 4 letters in the comments 3) updated document for new options v7->v6: 1) fix type of local variable in parse_tun_type 2) use up to 4 letters in the comments 3) document new options v6->v5: 1) split the patch into two: - ipvsadm: convert options to unsigned long long - ipvsadm: allow tunneling with gue encapsulation 2) do not mix static and dynamic allocation in fwd_tun_info 3) use correct nla_get/put function for tun_flags 4) fixed || style 5) use correct return value for parse_tun_type v5->v4: 1) add checksum support for gue encapsulation v4->v3: 1) removed changes to setsockopt interface 2) use correct nla_get/put function for tun_port v3->v2: 1) added missing break statements to a few switch cases v2->v1: 1) pass tun_type and tun_port as new optional parameters instead of a few bits in existing conn_flags parameters ============== Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-07-02ipvsadm: allow tunneling with gue encapsulationJacky Hu4-22/+408
Added the following options with adding and editing destinations for tunneling servers: --tun-type --tun-port --tun-nocsum --tun-csum --tun-remcsum Added the following options with listing services for tunneling servers: --tun-info Signed-off-by: Jacky Hu <hengqing.hu@gmail.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-07-02ipvsadm: convert options to unsigned long longJacky Hu1-48/+69
To allow up to 64 options to be specified. Add calculated logarithm constants for existing options. Remove opt2name function to avoid recalculation. Signed-off-by: Jacky Hu <hengqing.hu@gmail.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-07-02Release: Version 1.30v1.30Jesper Dangaard Brouer2-2/+2
There have not been a ipvsadm release for far too long. This release is focused on kernel release v4.18 and below, for adding the missing userspace side for the schedulers MH, FO and OVF. There are upcoming change for GUE and GRE, that are not part of this release. There have been very little development on the tool, but this release still contains userspace config to kernel side features that span many kernel releases. Special thanks to Quentin Armitage for adding this userspace side support, that was missing in ipvsadm. This release contains userspace support and/or doc for 3 more schedulers: - mh: Maglev Hashing: added in kernel v4.18 - ovf (doc): Weighted Overflow: added in kernel v4.3 - https://git.kernel.org/torvalds/c/eefa32d3f3c5 - fo (doc): Weighted FailOver: added in kernel v3.18 - https://git.kernel.org/torvalds/c/616a9be25cb9 This release is based on the kernel.org git tree: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/ You can download the tarballs from: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ Git tree: git://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-01-22Merge: ipvsadm: Document/add support for fo/ovf/mh schedulersJesper Dangaard Brouer4-3/+37
Quentin Armitage <quentin@armitage.org.uk> writes: The kernel supports the fo, ovf and mh IPVS schedulers, but ipvsadm has not yet been updated to document/support them. Currently ipvsadm can support them, but users of ipvsadm will not be aware of their existence without reading the kernel sources. The following patches document support for these schedulers, and also adds new flags mh-fallback and mh-port. Changes since v1: - Correct description of fo scheduler - Correct description of ovf scheduler - Completely rewrite description of mh scheduler - Move definitions of IP_VS_SVC_F_SCHED_MH* from ipvsadm.c to libipvs/ip_vs.h - Don't print flag-3 for SH and MH schedulers With many thanks to Julian Anastasov for pointing out the errors in the v1 patches and the suggested improvements. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2019-01-22Add support for mh schedulerQuentin Armitage4-3/+28
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg>
2019-01-22Document support of ovf schedulerQuentin Armitage2-1/+7
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg>
2019-01-22Document support of fo schedulerQuentin Armitage2-1/+4
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg>
2018-05-29libipvs: fix some buffer sizesJulian Anastasov3-9/+10
Size or length? Here is the answer: - IP_VS_SCHEDNAME_MAXLEN and IP_VS_IFNAME_MAXLEN are sizes because they are used in kernel structures exported to user space for the old setsockopt interface. We can not change these structures in the kernel. - IP_VS_PENAME_MAXLEN and IP_VS_PEDATA_MAXLEN are max lengths because they are not exported to the old interface. As result: - buffers should have space for NUL terminator - strncpy should use sizeof(buffer) - 1 as max length As we change the libipvs structures, their users should be recompiled. Maintainers notes: This change is related/inspired by kernel commit 52f96757905b ("ipvs: fix buffer overflow with sync daemon and service") found by syzkaller. While this fix is found by manual review. Signed-off-by: Julian Anastasov <ja@ssi.bg> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2017-10-05libipvs: discrepancy with libnl genlmsg_putArthur Gautier1-1/+1
There is a mixup between NL_AUTO_PORT and NL_AUTO_PID. The first should be used with genlmsg_put while the second with nlmsg_put. This is not a problem, because both NL_AUTO_PORT and NL_AUTO_PID have the same value, but still a discrepancy with libnl documentation. see documentation of genlmsg_put here: http://www.infradead.org/~tgr/libnl/doc/api/group__genl.html#ga9a86a71bbba6961d41b8a75f62f9e946 Cc: Julian Anastasov <ja@ssi.bg> Cc: Simon Horman <horms@verge.net.au> Cc: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Arthur Gautier <baloo@gandi.net> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2017-08-11ipvsadm: catch the original errno from netlink answerJulian Anastasov1-1/+21
nl_recvmsgs_default() returns NLE_* error codes and not errno values. As result, attempt to delete virtual service returns NLE_OBJ_NOTFOUND (12) which matches the ENOMEM value. Problem as reported by Emanuele Rocca: ipvsadm -D -t example.org:80 Memory allocation problem Fix it by providing generic error handler to catch the errno value as returned in netlink answer. By this way all netlink commands will get proper error string. The problem is present only when ipvsadm is compiled with libnl. ipvsadm -D -t example.org:80 No such service Reported-by: Emanuele Rocca <ema@wikimedia.org> Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2016-12-23Release: Version 1.29v1.29Jesper Dangaard Brouer2-2/+2
It has been far too long since the last ipvsadm release. Even-though only two changes to the ipvsadm tool happened since last release, a release must be made as these feature relates to kernel side features. Support for reading 64-bit stats is avail since kernel v4.1. The new attributes for sync daemon got introduced in kernel v4.3, but got fixed in kernel v4.7. Merry Xmas and a Happy New year to all :-) This release is based on the kernel.org git tree: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/ You can download the tarballs from: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ Git tree: git://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2015-08-20ipvsadm: new attributes for sync daemonJulian Anastasov5-44/+256
Add support for --sync-maxlen, --mcast-group, --mcast-port and --mcast-ttl options for the --start-daemon command. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2015-08-20ipvsadm: support 64-bit stats and ratesJulian Anastasov3-29/+121
Prefer the new netlink attributes IPVS_SVC_ATTR_STATS64 and IPVS_DEST_ATTR_STATS64 for 64-bit conn/packet/bps/cps/pps stats. Corresponding kernel commit cd67cd5eb25 ("ipvs: use 64-bit rates in stats") is avail in kernel 4.1. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2015-02-09Release: Version 1.28v1.28Jesper Dangaard Brouer2-2/+2
It has been quite a while since the previous release, v1.27. A number of fixes and improvements have been made; most noticeably in the area of IPv6. One big addition is the support for heterogeneous pools (v4 and v6 mixed pools in kernel 3.18), by Alex Gartrell (facebook). Feature wise the SCTP protocol has been added which is available via the cmdline parameter "--sctp-service". The kernel has supported SCTP since kernel 2.6.34 but up until now ipvsadm users have been restricted to using fwmark-based virtual services for SCTP. This release is based on the kernel.org git tree: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/ You can download the tarballs from: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ Git tree: git://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git Acked-by: Simon Horman <horms@verge.net.au> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2015-02-06ipvsadm: add SCTP supportJulian Anastasov2-32/+98
SCTP support in kernel is from 2.6.34 but ipvsadm restricts users to fwmark-based virtual services. * Add option --sctp-service to specify the virtual service * Update man page to use virtual-service and the new option Signed-off-by: Julian Anastasov <ja@ssi.bg> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2015-01-15ipvsadm: enable displaying of IPv6 hostnames in listingHibari Michiro1-2/+8
Lookups of IPv6 addresses to hostnames didn't work. This patch handles the lookup case with IPv6 in function addr_to_host(). In the future, we should convert it to use getnameinfo(3), but this patch fixes the issue at hand. Signed-off-by: Michiro Hibari <hibari.michiro@lab.ntt.co.jp> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-12-09ipvsadm: fix compile warning in modprobe_ipvsDaniel Borkmann1-1/+1
ipvsadm.c: In function ‘modprobe_ipvs’: ipvsadm.c:1249:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ Address this by also checking if waitpid(2) returned successfully before we check actual status information. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Simon Horman <horms@verge.net.au> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-12-09ipvsadm: fix compile warning in print_largenumDaniel Borkmann1-4/+4
ipvsadm.c: In function ‘print_largenum’: ipvsadm.c:1445:3: warning: field width specifier ‘*’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat=] printf("%*llu", len <= 8 ? 9 : len + 1, i); ^ Fix by reducing the scope and use int for len instead. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Simon Horman <horms@verge.net.au> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-09-10ipvsadm: do not truncate ipv6 members of v4 servicesAlex Gartrell1-1/+1
We need to compare to the entry af instead of the service af or else we'll pop a nul byte into the middle of a v6 real server address. Signed-off-by: Alex Gartrell <agartrell@fb.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-09-10ipvsadm: allow different address family in connection listingJulian Anastasov1-4/+7
Real server can have different address family, fix it for connection listing. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-09-10ipvsadm: restrict different address familyJulian Anastasov1-0/+6
Now real server can have different address family only for tunneling. For other modes it must match the service. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-08-30ipvsadm: specify real server address family to netlink socketAlex Gartrell3-2/+11
This is necessary for supporting heterogeneous pools (v4 and v6 mixed pools). Signed-off-by: Alex Gartrell <agartrell@fb.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-06-10ipvsadm: Fix list daemon to show backup daemonRyan O'Hara1-2/+2
The list_daemon function in ipvsadm.c will show the master daemon twice, but never the backup daemon. This patch replaces the redundant check for IP_VS_STATE_MASTER with a check for IP_VS_STATE_BACKUP, then prints the appropriate message. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-03-06libipvs: Initialize ipvs_service_t variableRyan O'Hara1-0/+1
The ipvs_get_service function declares an ipvs_service_t type variable and initializes some of the values, but should really start by initializing the entire structure. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-09-06Release: Version 1.27v1.27Jesper Dangaard Brouer1-1/+1
It have been quite a while since the last release of ipvsadm, as v1.26 were released on February 8, 2011. Since then, the source code repository have been converted into git. This is the first released based on the kernel.org git tree: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/ You can download the tarballs from: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ The older releases are also available via: http://www.linuxvirtualserver.org/software/ipvs.html#kernel-2.6 http://www.linuxvirtualserver.org/software/kernel-2.6/ Maintainers: Simon Horman <horms@verge.net.au> Jesper Dangaard Brouer <brouer@redhat.com> Wensong Zhang <wensong@linux-vs.org> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-09-06Maintainer script for releasing tarballsJesper Dangaard Brouer1-0/+123
Adding a script (release-tarball.sh) for making a release tarball, where we avoid including files not related to the git repository, by using git archive to a temp dir (mktemp). You need to create a git tag corrosponding with the version in the file VERSION, before you can make a release. For testing purposes, its possible to give a commit id on the command line via "-c" option. The script also creates a GPG signed file output of the uncompressed tarball (which is needed by kernel.org upload utility). A specific GPGKEY ID can be specified on the command line via "-g" option. The release tarballs and GPG signing files are placed in the directory "release/". Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-09-06Add MAINTAINERS style fileJesper Dangaard Brouer1-0/+33
Adding a MAINTAINERS file, to make it more clear who is maintaining the different parts of the IPVS project. Borrowing the kernel style MAINTAINERS listing. Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-09-06Make README more generic and reference new kernel.org locationJesper Dangaard Brouer1-8/+18
The old README were written for Version 1.20 - 18th September 2001. Change this to be more generic for future releases. Make it clear that SCM/git repository have been moved to kernel.org: https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git And release tarball also have moved to kernel.org: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-08-30ipvsadm: support for scheduler flagsAlexander Frolkin3-20/+128
This patch adds support for scheduler flags, necessary to make use of the "SH fallback and L4 hashing" kernel patch. The flags are set per service (so using -A or -E) using -b <flags> or --sched-flags <flags>. <flags> is a comma-separated list of scheduler flags. The currently supported flags are sh-port, sh-fallback, and generic flag-1, flag-2, flag-3 for future-proofing. This patch will work with older versions of IPVS, although setting the flags will have no effect. Signed-off-by: Alexander Frolkin <avf@eldamar.org.uk> Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-26ipvsadm: init svc in ipvs_get_serviceJulian Anastasov1-9/+16
ipvs_get_service() needs to init the allocated svc for the non-netlink case due to the used CHECK_COMPAT_SVC macro that includes pe_name[0] check in CHECK_PE. Use calloc to avoid reading random data. For the netlink case use malloc as before. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-22ipvsadm: Fix wrong format of --pe option in FMT_RULE listingJulian Anastasov1-1/+1
'ipvsadm -S' listed the persistence engine option in wrong format (' pe ...' instead of ' --pe ...') preventing any service with PE from restoring using 'ipvsadm -R'. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-22libipvs: CHECK_IPV4 and CHECK_PE macros should not call returnRyan O'Hara1-2/+19
The CHECK_IPV4 and CHECK_PE macros will call return if a conditional is true. This is a problem for any caller that has allocated memory and needs to do cleanup before returning. This patch replaces the return in both macros with a goto statement. As a result, each caller needs a out_err label. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-22libipvs: Remove redundant CHECK_PERyan O'Hara1-1/+0
Since the CHECK_COMPAT_SVC macro calls CHECK_PE, remove the extra CHECK_PE call from ipvs_get_service(). Signed-off-by: Ryan O'Hara <rohara@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-20libipvs: Fix memory leakHenrique Mecking1-2/+6
If malloc fails, free allocated memory before returning NULL. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-20ipvsadm: Fix svc->pe_name conditionalRyan O'Hara1-2/+2
The pe_name in ipvs_service_t is an array, so comparing it NULL has no effect. Check first byte of pe_name. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-13ipvsadm: detect LIBS and CFLAGS for libnl versionsJesper Dangaard Brouer2-1/+14
Automated detecting of LIBS and CFLAGS for different versions of libnl via using pkg-config, in the Makefiles. This should make it easier to compile on different distributions. Detecting in prioritized order from the most recent version, and only the first detected lib is used. Thus, supporting several libnl version being installed on the same system. Only tested with libnl-1 and libnl-3.0, but also adding support for libnl-2.0. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-08-09ipvsadm: fix compiling tool on distros with only libnl-1Jesper Dangaard Brouer2-0/+10
Some distros have not moved to libnl3 yet. Add a fallback option for compiling on distro's with only libnl1. Using pkg-config to detect what versions of libnl is available. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22ipvsadm: Show 'ops' flag regardless of service persistenceKrzysztof Gajdemski1-2/+2
In print_service_entry() 'ops' option is displayed only for services which have the IP_VS_SVC_F_PERSISTENT flag set. However, it should be displayed for any VS with one-packet scheduling because OPS can be also used without persistence. Signed-off-by: Krzysztof Gajdemski <songo@debian.org.pl> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22ipvsadm: Fix wrong format of -o option in FMT_RULE listingKrzysztof Gajdemski1-1/+1
'ipvsadm -S' listed one-packet scheduling option in wrong format ('ops' instead of '--ops' or '-o') preventing any service with OPS feature from restoring using 'ipvsadm -R'. Now we use '-o' which works well with save/restore commands. Signed-off-by: Krzysztof Gajdemski <songo@debian.org.pl> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22libipvs: Fix initialization of netlink (needed for IPv6) when the module ↵Alexander Holler1-0/+2
ip_vs wasn't loaded. The following happened when keepalived was started before the module for IPVS was loaded: ipvs_init() failed => netlink got disabled. modprobe_ipvs() ipvs_init() => netlink was not tested again => no netlink => no IPv6 Fixed through testing netlink always in ipvs_init(). Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22ipvsadm: fix list_daemon to handle master/backup status in either positionRyan O'Hara1-6/+9
Attached is a patch that fixes the list_daemon function such that it does not assume that the master sync daemon status is always in the first position and master sync daemon status is always in the second position. If libipvs uses the netlink interface to retrieve sync daemon status, the results are not guaranteed to follow this ordering. As explained in a previous email, if libipvs uses the netlink interface to retrieve sync daemon status while only a backup sync daemon is running, the backup sync daemon status will but in the first position (index 0). This differs from the getsockopt interface, which would always put master sync daemon status in first position and backup sync daemon status in the second position, even when only backup sync daemon exists. Solution is to make ipvsadm check both elements of the array for master and backup. Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22libipvs: libnl3: fix compilation errorDaniel Borkmann1-5/+5
nl_handle_* needs to be replaced by nl_socket_* equivalents in order to compile and work. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22Linking against libpopt is always requitedSimon Horman1-32/+1
It used to be the case that ipvsadm could be compiled to use getopt_long rather than libpopt. However, this is no longer the case and linking against libpopt is always requited. Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22ipvsadm: Fix buffer overrun in ipvs_dests_parse_cb()Tim Serong2-3/+3
The attrs and dest_attrs arrays in ipvs_dest_parse_cb() seem to be using the wrong defines for their length. This resulted in a buffer overrun corrupting EBX, which later caused a segfault running 'ipvsadm -Ln' on 32 bit intel (SLES 11 SP2). Signed-off-by: Tim Serong <tserong@suse.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22Fallback to libpopt on shared objectJulian Anastasov1-0/+15
Use shared library if no static library is installed. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22Fix the --pe option checksJulian Anastasov1-16/+16
Make sure the --pe option is at its place in optnames. Now it messes the names of all next options. Also, add the missing requirements for the --pe option in commands_v_options. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
2013-05-22exclude the .svn directory and the TAGS file while making distributionwensong1-1/+1
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@77 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22update the version number to 1.26wensong1-1/+1
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@76 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Add PERSISTENCE_ENGINESv1.26horms1-0/+1
Some how this was missing from the original persistence engines commit git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@75 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22apply the ipvsadm-1.24-Makefile.patch from ipvsadm-1.25-9.el6.src.rpmwensong1-4/+3
1. install ipvsadm without strip, so that debuginfo rpm can be generated correctly 2. create the $(INIT) directory if not exists git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@74 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Add support for persistence engineshorms5-25/+85
This adds the --pe [engine] option to the -A and -E commands which allows a persistence engine to be associated with a virtual service. The absence of --pe sets no persistence engine. The --pe option only works when ipvsadm is compiled to use netlink for user-space/kernel communication. This patch also allows the --persistent-conn option to be given to the -L command, which will list persistence engine data, if any is present, when listing connections (and persistence templates). At this time the only (proposed) persistence engine is sip. Signed-off-by: Simon Horman <horms@verge.net.au> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@73 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Remove bogus portion or commit r69horms2-2/+2
Signed-off-by: Simon Horman <horms@verge.net.au> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@72 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Slightly simplify options conflicts logichorms1-5/+3
Signed-off-by: Simon Horman <horms@verge.net.au> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@71 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22ipvsadm: Allow --ops only for adding and editing serviceshorms3-17/+17
Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Signed-off-by: Simon Horman <horms@verge.net.au> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@70 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Allow one-packet scheduling for UDP connections. When the fwmark-based orwensong3-3/+28
normal virtual service is marked with '-o' or '--ops' options all connections are created only to schedule one packet. Useful to schedule UDP packets from same client port to different real servers. Recommended with RR or WRR schedulers (the connections are not visible with ipvsadm -L). The kernel side of this change has already been merged and should appear in 2.6.35. Based on http://www.ssi.bg/~ja/tmp/ops-ipvsadm-1.21-1.diff by Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@69 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22I think that this significantly aids in the management ofwensong1-29/+49
these values while leaving all valid shortopts available as 'val' entries. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@68 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22tidy up the initializing value in the popt option_tablewensong1-46/+56
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@67 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22getopt isn't used any more.wensong1-1/+0
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@66 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22add the --ipv6 option in man agewensong1-1/+1
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@65 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22This fixes what appears to be a typo in the netlink client codewensong1-1/+1
whereby the activeconns is read as activeconns and then overwritten by persistentconns. The result is that the active connection count reported by ipvsadm -L is wrong if the code is compiled to use the netlink interface. Tested-by: Nigel Kukard <nkukard@lbsd.net> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Wensong Zhang <wensong@linux-vs.org> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@64 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22ipvsadm.8: fix typoshorms1-3/+3
Signed-off-by: Hannes Eder <heder@google.com> Signed-off-by: Simon Horman <horms@verge.net.au> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@63 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Patch to make ipvsadm compile on 64-bit only RHEL5wensong1-1/+2
from "West, Rob" <Rob.West@tekelec.com> git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@62 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Make some local variables static.vince1-2/+3
Fix bug where the first run of ipvsadm would fall back to the old sockopt interface if the module wasn't loaded. git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@61 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22update the version number 1.25v1.25wensong1-1/+1
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@60 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22code tidy upwensong4-36/+33
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@59 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Only use linux/types.hvince2-5/+1
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@58 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22More files to bring release up to 1.24 with IPv6 changes.vince6-0/+1902
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@57 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Add IPv6 changesvince6-400/+231
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@56 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22More files from ipvsadm-1.24v1.24vince4-0/+4
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@55 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22Import ipvsadm-1.24 from Dec 10, 2005wensong20-1612/+2532
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@54 36f5d8da-7431-0410-8ca5-ec586ed2521a
2013-05-22ipvsadm v1.12 releasev1.12wensong12-0/+2814
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@39 36f5d8da-7431-0410-8ca5-ec586ed2521a
1999-07-01New repository initialized by cvs2svn.(no author)0-0/+0
git-svn-id: http://svn.linuxvirtualserver.org/repos/ipvsadm/trunk@1 36f5d8da-7431-0410-8ca5-ec586ed2521a