!5 update to 3.0.4
From: @xinghe_1 Reviewed-by: @zengwefeng Signed-off-by: @zengwefeng
This commit is contained in:
commit
d47b1c49de
50
backport-tipcutils-format_errors.patch
Normal file
50
backport-tipcutils-format_errors.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 46d1e5a17f17b8798865446191bb3a3a620cea95 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
Date: Fri, 5 Jul 2019 13:23:51 +1200
|
||||
Subject: [PATCH] tipcutils/utils: fix printf format warnings on 32-bit
|
||||
platforms
|
||||
|
||||
Use PRIu64 when printing a uint64_t so that both 32-bit and 64-bit
|
||||
platforms use the correct format specifier.
|
||||
|
||||
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
|
||||
Conflict: NA
|
||||
Reference: https://sourceforge.net/p/tipc/tipcutils/ci/46d1e5a17f17b8798865446191bb3a3a620cea95/
|
||||
---
|
||||
utils/tipc-link-watcher/tipc-link-watcher.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/utils/tipc-link-watcher/tipc-link-watcher.c b/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
index 943ea4f..f805e1c 100644
|
||||
--- a/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
+++ b/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include <linux/tipc.h>
|
||||
#include <linux/tipc_netlink.h>
|
||||
+#include <inttypes.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -578,7 +579,7 @@ static void print_uc_samples_to_file(char *filename,
|
||||
fprintf(csv_fp,"priority(%u), ", (*samples)[link].link_props.priority[link]);
|
||||
fprintf(csv_fp,"tolerance(%u ms), ", (*samples)[link].link_props.tolerance[link]);
|
||||
fprintf(csv_fp,"window(%u packets), ", (*samples)[link].link_props.window[link]);
|
||||
- fprintf(csv_fp,"link_up(%lu), link_down(%lu)",
|
||||
+ fprintf(csv_fp,"link_up(%" PRIu64 "), link_down(%" PRIu64 ")",
|
||||
(*samples)[link].link_state.up, (*samples)[link].link_state.down);
|
||||
fprintf(csv_fp,"\n");
|
||||
/* skip link_state*/
|
||||
@@ -1354,7 +1355,7 @@ static int l1_unicast_sample(int index,
|
||||
IF_WATCH(w_linkp->action,
|
||||
(look_up_link_index(uc_dp->samples[index].link_info.link,
|
||||
w_linkp->action_list, w_linkp->action) >= 0),
|
||||
- printf("\n%s: link reset:%-10lu ", (uc_dp)->samples[index].link_info.link, (uc_dp)->samples[index].link_state.down));
|
||||
+ printf("\n%s: link reset:%-10" PRIu64 " ", (uc_dp)->samples[index].link_info.link, (uc_dp)->samples[index].link_state.down));
|
||||
|
||||
for (i = PRIV_TIPC_NLA_STATS_RX_PACKETS; i < __PRIV_TIPC_NLA_STATS_MAX; i++) {
|
||||
stat_p = (uint32_t *)(uintptr_t)*offset_p;
|
||||
--
|
||||
2.41.0
|
||||
|
||||
91
backport-tipcutils-str_warnings.patch
Normal file
91
backport-tipcutils-str_warnings.patch
Normal file
@ -0,0 +1,91 @@
|
||||
From c83051724c1d608680f0c80182533285ec10aab6 Mon Sep 17 00:00:00 2001
|
||||
From: Li Shuang <shuali@redhat.com>
|
||||
Date: Wed, 27 Mar 2019 11:39:04 +0800
|
||||
Subject: [PATCH] tipcutils/utils: fixed several compile errors in
|
||||
tipc-link-watcher.c
|
||||
|
||||
Conflict: NA
|
||||
Reference: https://sourceforge.net/p/tipc/tipcutils/ci/c83051724c1d608680f0c80182533285ec10aab6/
|
||||
---
|
||||
utils/tipc-link-watcher/tipc-link-watcher.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/utils/tipc-link-watcher/tipc-link-watcher.c b/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
index a24cf19..943ea4f 100644
|
||||
--- a/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
+++ b/utils/tipc-link-watcher/tipc-link-watcher.c
|
||||
@@ -908,7 +908,7 @@ static void add_resource(const char *name,
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
- strncpy(resource_p->name, name, strlen(name));
|
||||
+ memcpy(resource_p->name, name, strlen(name));
|
||||
*(resource) = newArray;
|
||||
(*(resource))[(*count)++] = *resource_p;
|
||||
}
|
||||
@@ -988,7 +988,7 @@ static void uc_add_link(const char *name,
|
||||
tot_mem = (*uc_dp)->mem;
|
||||
/* linkstate miscellaneous */
|
||||
new_link->link_misc.link_state = tot_mem;
|
||||
- strncpy(new_link->link_misc.link_state, link_state, strlen(link_state));
|
||||
+ memcpy(new_link->link_misc.link_state, link_state, strlen(link_state));
|
||||
*(new_link->link_misc.link_state + strlen(link_state)) = '\0';
|
||||
|
||||
/* Make space for nos of linkstate string and null character!*/
|
||||
@@ -999,7 +999,7 @@ static void uc_add_link(const char *name,
|
||||
SET_MEM_AND_STEP(offset_p, step_size, tot_mem);
|
||||
|
||||
new_link->link_info.link = tot_mem;
|
||||
- strncpy(new_link->link_info.link, name, strlen(name));
|
||||
+ memcpy(new_link->link_info.link, name, strlen(name));
|
||||
*(new_link->link_info.link + strlen(name)) = '\0';
|
||||
tot_mem = tot_mem + (((strlen(name) + 1) + (4 - 1)) & - 4);
|
||||
SET_OFFSET_AND_STEP(offset_p, 0, new_link, link_info);
|
||||
@@ -1552,7 +1552,7 @@ static bool handle_getsubopt(char **optionp, char *const *tokens,
|
||||
int sub_opt;
|
||||
int tmp;
|
||||
char *valuep;
|
||||
- while (*optionp != '\0') {
|
||||
+ while (*optionp != 0x0) {
|
||||
sub_opt = getsubopt (optionp, tokens, &valuep);
|
||||
if ((t_low < sub_opt) && (sub_opt < t_high) )
|
||||
{
|
||||
@@ -1596,7 +1596,7 @@ static int handle_opts(int argc, char *const argv[])
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
- strncpy(r_linkp->action_list[r_linkp->action], optarg, strlen(optarg));
|
||||
+ memcpy(r_linkp->action_list[r_linkp->action], optarg, strlen(optarg));
|
||||
r_linkp->action++;
|
||||
break;
|
||||
case 'l':
|
||||
@@ -1608,7 +1608,7 @@ static int handle_opts(int argc, char *const argv[])
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
- strncpy(w_linkp->action_list[w_linkp->action], optarg, strlen(optarg));
|
||||
+ memcpy(w_linkp->action_list[w_linkp->action], optarg, strlen(optarg));
|
||||
w_linkp->action++;
|
||||
break;
|
||||
case 'n':
|
||||
@@ -1620,7 +1620,7 @@ static int handle_opts(int argc, char *const argv[])
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
- strncpy(w_nodep->action_list[w_nodep->action], optarg, strlen(optarg));
|
||||
+ memcpy(w_nodep->action_list[w_nodep->action], optarg, strlen(optarg));
|
||||
w_nodep->action++;
|
||||
break;
|
||||
case 'f':
|
||||
@@ -1633,7 +1633,7 @@ static int handle_opts(int argc, char *const argv[])
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
- strncpy(user_dir, optarg, strlen(optarg));
|
||||
+ memcpy(user_dir, optarg, strlen(optarg));
|
||||
printf(" %d \n", __LINE__);
|
||||
fflush(stdout);
|
||||
break;
|
||||
--
|
||||
2.41.0
|
||||
|
||||
BIN
tipc-tipcutils-63d1d465a7c27d661f29d11803c354bda10df53c.zip
Normal file
BIN
tipc-tipcutils-63d1d465a7c27d661f29d11803c354bda10df53c.zip
Normal file
Binary file not shown.
Binary file not shown.
@ -1,14 +1,17 @@
|
||||
%define versioncommit dc8c2d324cda2e80a6e07ee1998fca0839d4a721
|
||||
%define versioncommit 63d1d465a7c27d661f29d11803c354bda10df53c
|
||||
|
||||
Name: tipcutils
|
||||
Version: 2.2.0
|
||||
Release: 4
|
||||
License: BSD and GPLv2
|
||||
Version: 3.0.4
|
||||
Release: 1
|
||||
License: BSD
|
||||
URL: https://sourceforge.net/projects/tipc/
|
||||
Summary: Utils package required to configure TIPC
|
||||
Source0: https://sourceforge.net/code-snapshots/git/t/ti/tipc/tipcutils.git/tipc-%{name}-%{versioncommit}.zip
|
||||
|
||||
BuildRequires: gcc autoconf automake libtool libdaemon-devel
|
||||
Patch1: backport-tipcutils-str_warnings.patch
|
||||
Patch2: backport-tipcutils-format_errors.patch
|
||||
|
||||
BuildRequires: gcc autoconf automake libtool libdaemon-devel libmnl-devel make
|
||||
|
||||
%description
|
||||
A fundamental concept in TIPC is that of Service Addressing
|
||||
@ -19,11 +22,18 @@ bind it to a server socket and let client programs use only that address for sen
|
||||
|
||||
%prep
|
||||
%autosetup -n tipc-%{name}-%{versioncommit} -p1
|
||||
head -n34 tipclog/tipc.h | tail -n21 | sed -e 's/ \* //g' -e 's/\*//g' > LICENSE
|
||||
head -n34 include/tipcc.h | tail -n25 | sed -e 's/ \* //g' -e 's/\*//g' > LICENSE
|
||||
|
||||
# undefined UIO_MAXIOV in iovec_client.c => skip it
|
||||
sed -ie 's/ iovec / /g' test/Makefile.am
|
||||
|
||||
# tipc-trace needs Python2 => skip it
|
||||
sed -ie 's/ tipc-trace//g' utils/Makefile.am
|
||||
|
||||
%build
|
||||
./bootstrap
|
||||
%configure
|
||||
LDFLAGS="-fPIE" \
|
||||
%configure
|
||||
make
|
||||
|
||||
%install
|
||||
@ -33,6 +43,7 @@ make
|
||||
%defattr(-,root,root)
|
||||
%license LICENSE
|
||||
%{_sbindir}/tipclog
|
||||
%{_sbindir}/tipc-link-watcher
|
||||
%{_bindir}/tipc-pipe
|
||||
|
||||
%files help
|
||||
@ -44,6 +55,12 @@ make
|
||||
make check
|
||||
|
||||
%changelog
|
||||
* Thu Dec 28 2023 xinghe <xinghe2@h-partners.com> - 3.0.4-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update to 3.0.4
|
||||
|
||||
* Thu Sep 10 2020 lunankun <lunankun@huawei.com> - 2.2.0-4
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user