Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
d3b87d5753
!16 [sync] PR-14: support specify cc
From: @openeuler-sync-bot 
Reviewed-by: @sunsuwan 
Signed-off-by: @sunsuwan
2024-04-01 08:15:12 +00:00
luofeng14
1eb33e68d7 support clang build
(cherry picked from commit b69d0db9981b0f550815aecbded55af336ac0ff7)
2024-04-01 14:39:36 +08:00
openeuler-ci-bot
383728a315
!10 [sync] PR-9: update to 1.31-5
From: @openeuler-sync-bot 
Reviewed-by: @wangxp006 
Signed-off-by: @wangxp006
2022-04-22 09:49:37 +00:00
kwb0523
ec6c0176a3 update to 1.31-5
(cherry picked from commit e64213eb5c62a613b45d1188685ec01daa1eae72)
2022-04-22 17:26:20 +08:00
openeuler-ci-bot
5fd99b8c9f !5 add yaml
Merge pull request !5 from zhouxudong8/zhou
2020-07-28 15:23:12 +08:00
yeah_wang
bd4f6d7083 add yaml 2020-07-27 14:14:49 +08:00
openeuler-ci-bot
dfc1d776cc !4 update to master
Merge pull request !4 from zhouxudong8/openEuler-20.03-LTS
2020-07-25 14:28:50 +08:00
openeuler-ci-bot
d434258b22 !3 update to 1.31
Merge pull request !3 from seuzw/master
2020-05-12 15:24:19 +08:00
seuzw
1eaeb8f609 update to 1.31 2020-05-12 14:02:40 +08:00
openeuler-ci-bot
3c848f33bf !2 Add ipvsadm.yaml
Merge pull request !2 from yaokai13/master
2020-05-11 20:21:54 +08:00
yaokai13
e1a768a9be Add ipvsadm.yaml 2020-05-09 14:15:36 +08:00
7 changed files with 68 additions and 126 deletions

Binary file not shown.

BIN
ipvsadm-1.31.tar.gz Normal file

Binary file not shown.

View File

@ -1,80 +0,0 @@
From f8cff0808a24b1dd141e86cc8039108aa1763071 Mon Sep 17 00:00:00 2001
From: Julian Anastasov <ja@ssi.bg>
Date: Sat, 5 Aug 2017 14:38:28 +0300
Subject: [PATCH 1/2] ipvsadm: catch the original errno from netlink answer
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>
---
libipvs/libipvs.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
index 180ea42..d271c48 100644
--- a/libipvs/libipvs.c
+++ b/libipvs/libipvs.c
@@ -74,9 +74,23 @@ static int ipvs_nl_noop_cb(struct nl_msg *msg, void *arg)
return NL_OK;
}
+struct cb_err_data {
+ int err;
+};
+
+static int ipvs_nl_err_cb(struct sockaddr_nl *nla, struct nlmsgerr *nlerr,
+ void *arg)
+{
+ struct cb_err_data *data = arg;
+
+ data->err = nlerr->error;
+ return -nl_syserr2nlerr(nlerr->error);
+}
+
int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg)
{
int err = EINVAL;
+ struct cb_err_data err_data = { .err = 0 };
sock = nl_socket_alloc();
if (!sock) {
@@ -100,12 +114,18 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg
if (nl_socket_modify_cb(sock, NL_CB_VALID, NL_CB_CUSTOM, func, arg) != 0)
goto fail_genl;
+ if (nl_socket_modify_err_cb(sock, NL_CB_CUSTOM, ipvs_nl_err_cb,
+ &err_data) != 0)
+ goto fail_genl;
if (nl_send_auto_complete(sock, msg) < 0)
goto fail_genl;
- if ((err = -nl_recvmsgs_default(sock)) > 0)
+ if (nl_recvmsgs_default(sock) < 0) {
+ if (err_data.err)
+ err = -err_data.err;
goto fail_genl;
+ }
nlmsg_free(msg);
--
2.14.3

23
ipvsadm-config Normal file
View File

@ -0,0 +1,23 @@
# Unload modules on restart and stop
# Value: yes|no, default: yes
# This option has to be 'yes' to get to a sane state for a ipvs
# restart or stop. Only set to 'no' if there are problems unloading ipvs
# modules.
IPVS_MODULES_UNLOAD="yes"
# Save current ipvs rules on stop.
# Value: yes|no, default: no
# Saves all ipvs rules to /etc/sysconfig/ipvsadm if ipvsadm gets stopped
# (e.g. on system shutdown).
IPVS_SAVE_ON_STOP="no"
# Save current ipvs rules on restart.
# Value: yes|no, default: no
# Saves all ipvs rules to /etc/sysconfig/ipvsadm if ipvsadm gets
# restarted.
IPVS_SAVE_ON_RESTART="no"
# Numeric status output
# Value: yes|no, default: yes
# Print IP addresses and port numbers in numeric format in the status output.
IPVS_STATUS_NUMERIC="yes"

View File

@ -1,15 +1,14 @@
Name: ipvsadm
Version: 1.29
Release: 11
Version: 1.31
Release: 6
Summary: A utility to administer the IP virtual server services
License: GPLv2+
URL: https://kernel.org/pub/linux/utils/kernel/ipvsadm/
Source0: https://kernel.org/pub/linux/utils/kernel/ipvsadm/%{name}-%{version}.tar.gz
Source1: ipvsadm.service
Source2: ipvsadm-config
Patch6000: ipvsadm-catch-the-original-errno-from-netlink-answer.patch
Patch6001: libipvs-discrepancy-with-libnl-genlmsg_put.patch
Patch6002: ipvsadm-use-CFLAGS-and-LDFLAGS-environment-variables.patch
Patch6000: ipvsadm-use-CFLAGS-and-LDFLAGS-environment-variables.patch
BuildRequires: gcc libnl3-devel popt-devel systemd
Requires(post): systemd
@ -27,7 +26,11 @@ offered by the Linux kernel with IP virtual server support.
%build
%set_build_flags
make
%if "%{?toolchain}" == "clang"
%global make_opts CC=clang CXX=clang++
%endif
make %{?make_opts}
%install
rm -rf %{buildroot}
@ -35,6 +38,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
make install BUILD_ROOT=%{buildroot}%{_prefix} SBIN=%{buildroot}%{_sbindir} MANDIR=%{buildroot}%{_mandir} MAN=%{buildroot}%{_mandir}/man8 INIT=%{buildroot}%{_sysconfdir}/rc.d/init.d
rm -f %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name}
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
install -p -D -m 0600 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-config
%preun
%systemd_preun %{name}.service
@ -50,11 +54,42 @@ install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%doc MAINTAINERS README
%{_sbindir}/ipvsadm*
%{_unitdir}/ipvsadm.service
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-config
%files help
%{_mandir}/man8/*8*
%changelog
* Fri Apr 14 2023 jammyjellyfish <jammyjellyfish255@outlook.com> - 1.31-6
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support specify CC
* Fri Apr 22 2022 kwb0523 <kwb0523@163.com> - 1.31-5
- Type: requirement
- ID: NA
- SUG: NA
- DESC: update to 1.31-5
* Mon Jul 27 2020 zhouxuodng <zhouxudong8@huawei.com> - 1.31-2
- Type: requirement
- ID: NA
- SUG: NA
- DESC: add yaml
* Mon Apr 20 2020 zhouxudong <zhouxudong8@huawei.com> - 1.31-1
- Type: requirement
- ID: NA
- SUG: NA
- DESC: update to 1.31
* Mon Mar 02 2020 wangxiaopeng <wangxiaopeng7@huawei.com> - 1.29-12
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:sync ipvsadm for next branch
* Mon Dec 30 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.29-11
- Type:bugfix
- ID:NA

4
ipvsadm.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: git
src_repo: https://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git
tag_prefix: ^v
seperator: .

View File

@ -1,40 +0,0 @@
From 76c1270148161242f240d9a00746cf06d916b3e3 Mon Sep 17 00:00:00 2001
From: Arthur Gautier <baloo@gandi.net>
Date: Wed, 27 Sep 2017 15:31:05 +0000
Subject: [PATCH 2/2] libipvs: discrepancy with libnl genlmsg_put
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>
---
libipvs/libipvs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
index d271c48..a843243 100644
--- a/libipvs/libipvs.c
+++ b/libipvs/libipvs.c
@@ -63,7 +63,7 @@ struct nl_msg *ipvs_nl_message(int cmd, int flags)
if (!msg)
return NULL;
- genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, flags,
+ genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, family, 0, flags,
cmd, IPVS_GENL_VERSION);
return msg;
--
2.14.3