open-iscsi: update to 2.1.3lilik-openwrt-22.03
@ -1,62 +0,0 @@ | |||||
From d4ed4972df1ffe9381e33f2800f8e574f632948c Mon Sep 17 00:00:00 2001 | |||||
From: rpm-build <rpm-build> | |||||
Date: Mon, 2 Mar 2020 15:21:30 -0800 | |||||
Subject: [PATCH 1/1] iscsi_if.h replace zero-length array with flexible-array | |||||
member | |||||
--- | |||||
include/iscsi_if.h | 10 +++++----- | |||||
1 file changed, 5 insertions(+), 5 deletions(-) | |||||
diff --git a/include/iscsi_if.h b/include/iscsi_if.h | |||||
index 2d46214..e8cee0d 100644 | |||||
--- a/include/iscsi_if.h | |||||
+++ b/include/iscsi_if.h | |||||
@@ -337,7 +337,7 @@ enum iscsi_param_type { | |||||
struct iscsi_param_info { | |||||
uint32_t len; /* Actual length of the param value */ | |||||
uint16_t param; /* iscsi param */ | |||||
- uint8_t value[0]; /* length sized value follows */ | |||||
+ uint8_t value[]; /* length sized value follows */ | |||||
} __attribute__((__packed__)); | |||||
struct iscsi_iface_param_info { | |||||
@@ -346,7 +346,7 @@ struct iscsi_iface_param_info { | |||||
uint16_t param; /* iscsi param value */ | |||||
uint8_t iface_type; /* IPv4 or IPv6 */ | |||||
uint8_t param_type; /* iscsi_param_type */ | |||||
- uint8_t value[0]; /* length sized value follows */ | |||||
+ uint8_t value[]; /* length sized value follows */ | |||||
} __attribute__((__packed__)); | |||||
/* | |||||
@@ -723,7 +723,7 @@ enum iscsi_flashnode_param { | |||||
struct iscsi_flashnode_param_info { | |||||
uint32_t len; /* Actual length of the param */ | |||||
uint16_t param; /* iscsi param value */ | |||||
- uint8_t value[0]; /* length sized value follows */ | |||||
+ uint8_t value[]; /* length sized value follows */ | |||||
} __attribute__((__packed__)); | |||||
enum iscsi_discovery_parent_type { | |||||
@@ -841,7 +841,7 @@ struct iscsi_stats { | |||||
* up to ISCSI_STATS_CUSTOM_MAX | |||||
*/ | |||||
uint32_t custom_length; | |||||
- struct iscsi_stats_custom custom[0] | |||||
+ struct iscsi_stats_custom custom[] | |||||
__attribute__ ((aligned (sizeof(uint64_t)))); | |||||
}; | |||||
@@ -972,7 +972,7 @@ struct iscsi_offload_host_stats { | |||||
* up to ISCSI_HOST_STATS_CUSTOM_MAX | |||||
*/ | |||||
uint32_t custom_length; | |||||
- struct iscsi_host_stats_custom custom[0] | |||||
+ struct iscsi_host_stats_custom custom[] | |||||
__attribute__ ((aligned (sizeof(uint64_t)))); | |||||
}; | |||||
-- | |||||
2.21.1 | |||||
@ -1,65 +0,0 @@ | |||||
From b32f59619c32ed6cd136194d92c649b74926c6f2 Mon Sep 17 00:00:00 2001 | |||||
From: Lee Duncan <lduncan@suse.com> | |||||
Date: Wed, 25 Mar 2020 18:00:50 -0700 | |||||
Subject: [PATCH] Fix issue where "iscsi-iname -p" core dumps. | |||||
While I was at it, I made the usage message a function | |||||
and made it print to stderr insted of stdout. | |||||
--- | |||||
utils/Makefile | 2 +- | |||||
utils/iscsi-iname.c | 17 +++++++++++++---- | |||||
2 files changed, 14 insertions(+), 5 deletions(-) | |||||
diff --git a/utils/Makefile b/utils/Makefile | |||||
index f65f1e79..aed3bb0a 100644 | |||||
--- a/utils/Makefile | |||||
+++ b/utils/Makefile | |||||
@@ -1,7 +1,7 @@ | |||||
# This Makefile will work only with GNU make. | |||||
CFLAGS ?= -O2 -fno-inline -g | |||||
-CFLAGS += -Wall -Wstrict-prototypes | |||||
+CFLAGS += -Wall -Wextra -Wstrict-prototypes | |||||
PROGRAMS = iscsi-iname | |||||
all: $(PROGRAMS) | |||||
diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c | |||||
index da850dca..0f587e1e 100644 | |||||
--- a/utils/iscsi-iname.c | |||||
+++ b/utils/iscsi-iname.c | |||||
@@ -40,6 +40,13 @@ | |||||
* a seperator and 12 characters (6 random bytes in hex representation) */ | |||||
#define PREFIX_MAX_LEN 210 | |||||
+static void usage(void) | |||||
+{ | |||||
+ fprintf(stderr, "Usage: iscsi-iname [-h | --help | -p <prefix>]\n"); | |||||
+ fprintf(stderr, "where <prefix> has max length of %d\n", | |||||
+ PREFIX_MAX_LEN); | |||||
+} | |||||
+ | |||||
int | |||||
main(int argc, char *argv[]) | |||||
{ | |||||
@@ -68,15 +75,17 @@ main(int argc, char *argv[]) | |||||
"on every invocation.\n"); | |||||
exit(0); | |||||
} else if ( strcmp(prefix, "-p") == 0 ) { | |||||
+ if (argc != 3) { | |||||
+ usage(); | |||||
+ exit(1); | |||||
+ } | |||||
prefix = argv[2]; | |||||
if (strnlen(prefix, PREFIX_MAX_LEN + 1) > PREFIX_MAX_LEN) { | |||||
- printf("Error: Prefix cannot exceed %d " | |||||
- "characters.\n", PREFIX_MAX_LEN); | |||||
+ usage(); | |||||
exit(1); | |||||
} | |||||
} else { | |||||
- printf("\nUsage: iscsi-iname [-h | --help | " | |||||
- "-p <prefix>]\n"); | |||||
+ usage(); | |||||
exit(0); | |||||
} | |||||
} else { |
@ -1,173 +0,0 @@ | |||||
From 6ed14d48f6e9a8dfb37cc68472b04cfb3673b7bd Mon Sep 17 00:00:00 2001 | |||||
From: Lee Duncan <lduncan@suse.com> | |||||
Date: Fri, 27 Mar 2020 17:50:41 -0700 | |||||
Subject: [PATCH 1/3] Change include of <sys/poll.h> to <poll.h> | |||||
The proper local is <poll.h>. | |||||
--- | |||||
iscsiuio/src/unix/nic_nl.c | 2 +- | |||||
usr/discovery.c | 2 +- | |||||
usr/event_poll.c | 2 +- | |||||
usr/io.c | 2 +- | |||||
usr/netlink.c | 2 +- | |||||
5 files changed, 5 insertions(+), 5 deletions(-) | |||||
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c | |||||
index f8306563..dee462e7 100644 | |||||
--- a/iscsiuio/src/unix/nic_nl.c | |||||
+++ b/iscsiuio/src/unix/nic_nl.c | |||||
@@ -50,7 +50,7 @@ | |||||
#include <linux/netlink.h> | |||||
#include <iscsi_if.h> | |||||
#include <sys/ioctl.h> | |||||
-#include <sys/poll.h> | |||||
+#include <poll.h> | |||||
#include <sys/types.h> | |||||
#include <sys/user.h> | |||||
#include <sys/socket.h> | |||||
diff --git a/usr/discovery.c b/usr/discovery.c | |||||
index 9ce122e1..7dec696f 100644 | |||||
--- a/usr/discovery.c | |||||
+++ b/usr/discovery.c | |||||
@@ -25,7 +25,7 @@ | |||||
#include <stdint.h> | |||||
#include <stdlib.h> | |||||
#include <string.h> | |||||
-#include <sys/poll.h> | |||||
+#include <poll.h> | |||||
#include <sys/time.h> | |||||
#include <sys/param.h> | |||||
#include <sys/socket.h> | |||||
diff --git a/usr/event_poll.c b/usr/event_poll.c | |||||
index 4cf4ce2b..ffd12a37 100644 | |||||
--- a/usr/event_poll.c | |||||
+++ b/usr/event_poll.c | |||||
@@ -23,7 +23,7 @@ | |||||
*/ | |||||
#include <stdlib.h> | |||||
#include <errno.h> | |||||
-#include <sys/poll.h> | |||||
+#include <poll.h> | |||||
#include <sys/types.h> | |||||
#include <sys/wait.h> | |||||
#include <sys/signalfd.h> | |||||
diff --git a/usr/io.c b/usr/io.c | |||||
index 210a10ad..a46c9f8c 100644 | |||||
--- a/usr/io.c | |||||
+++ b/usr/io.c | |||||
@@ -24,7 +24,7 @@ | |||||
#include <signal.h> | |||||
#include <unistd.h> | |||||
#include <fcntl.h> | |||||
-#include <sys/poll.h> | |||||
+#include <poll.h> | |||||
#include <sys/ioctl.h> | |||||
#include <netinet/tcp.h> | |||||
#include <arpa/inet.h> | |||||
diff --git a/usr/netlink.c b/usr/netlink.c | |||||
index d42ca4fb..22cad834 100644 | |||||
--- a/usr/netlink.c | |||||
+++ b/usr/netlink.c | |||||
@@ -30,7 +30,7 @@ | |||||
#include <asm/types.h> | |||||
#include <sys/socket.h> | |||||
#include <sys/types.h> | |||||
-#include <sys/poll.h> | |||||
+#include <poll.h> | |||||
#include <linux/netlink.h> | |||||
#include "types.h" | |||||
From fbe6c1c766a88edccb0d7f4168d2d87a3cdb4660 Mon Sep 17 00:00:00 2001 | |||||
From: Lee Duncan <lduncan@suse.com> | |||||
Date: Fri, 27 Mar 2020 17:57:52 -0700 | |||||
Subject: [PATCH 2/3] Fix type mismatch under musl. | |||||
It complains about rl.rlim_cur and rl.rlim_max being | |||||
long long unsigned, so cast them, since it's debug | |||||
messages anyway. | |||||
--- | |||||
usr/iscsi_util.c | 7 +++++-- | |||||
1 file changed, 5 insertions(+), 2 deletions(-) | |||||
diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c | |||||
index fd8fc0cf..db1dc377 100644 | |||||
--- a/usr/iscsi_util.c | |||||
+++ b/usr/iscsi_util.c | |||||
@@ -152,7 +152,9 @@ int increase_max_files(void) | |||||
log_debug(1, "Could not get file limit (err %d)", errno); | |||||
return errno; | |||||
} | |||||
- log_debug(1, "Max file limits %lu %lu", rl.rlim_cur, rl.rlim_max); | |||||
+ log_debug(1, "Max file limits %lu %lu", | |||||
+ (long unsigned)rl.rlim_cur, | |||||
+ (long unsigned)rl.rlim_max); | |||||
if (rl.rlim_cur < ISCSI_MAX_FILES) | |||||
rl.rlim_cur = ISCSI_MAX_FILES; | |||||
@@ -162,7 +164,8 @@ int increase_max_files(void) | |||||
err = setrlimit(RLIMIT_NOFILE, &rl); | |||||
if (err) { | |||||
log_debug(1, "Could not set file limit to %lu/%lu (err %d)", | |||||
- rl.rlim_cur, rl.rlim_max, errno); | |||||
+ (long unsigned)rl.rlim_cur, | |||||
+ (long unsigned)rl.rlim_max, errno); | |||||
return errno; | |||||
} | |||||
From a93c2f1cf5a55887074bdda65aa6ad6c533191f0 Mon Sep 17 00:00:00 2001 | |||||
From: Lee Duncan <lduncan@suse.com> | |||||
Date: Sun, 29 Mar 2020 11:01:07 -0700 | |||||
Subject: [PATCH 3/3] More changes for musl. | |||||
Clean up some code that musl complains about. The | |||||
changes all seem like a good idea in general, and | |||||
should not effect functionality. | |||||
--- | |||||
usr/iscsistart.c | 1 - | |||||
usr/mgmt_ipc.c | 1 + | |||||
usr/statics.c | 3 +-- | |||||
3 files changed, 2 insertions(+), 3 deletions(-) | |||||
diff --git a/usr/iscsistart.c b/usr/iscsistart.c | |||||
index 00a9c78a..ee810f7a 100644 | |||||
--- a/usr/iscsistart.c | |||||
+++ b/usr/iscsistart.c | |||||
@@ -30,7 +30,6 @@ | |||||
#include <time.h> | |||||
#include <sys/mman.h> | |||||
#include <sys/utsname.h> | |||||
-#include <sys/signal.h> | |||||
#include <sys/types.h> | |||||
#include <sys/wait.h> | |||||
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c | |||||
index 51267c13..c292161f 100644 | |||||
--- a/usr/mgmt_ipc.c | |||||
+++ b/usr/mgmt_ipc.c | |||||
@@ -26,6 +26,7 @@ | |||||
#include <unistd.h> | |||||
#include <pwd.h> | |||||
#include <sys/un.h> | |||||
+#include <string.h> | |||||
#include "iscsid.h" | |||||
#include "idbm.h" | |||||
diff --git a/usr/statics.c b/usr/statics.c | |||||
index 59fb044d..f59729ba 100644 | |||||
--- a/usr/statics.c | |||||
+++ b/usr/statics.c | |||||
@@ -1,6 +1,6 @@ | |||||
#include <unistd.h> | |||||
#include <pwd.h> | |||||
-#include <sys/errno.h> | |||||
+#include <errno.h> | |||||
#include <sys/types.h> | |||||
static struct passwd root_pw = { | |||||
@@ -17,4 +17,3 @@ getpwuid(uid_t uid) | |||||
return 0; | |||||
} | |||||
} | |||||
- |
@ -1,25 +0,0 @@ | |||||
From 16d4899d52b3b88774ac6d9b3cc0f5626f4705da Mon Sep 17 00:00:00 2001 | |||||
From: Lee Duncan <lduncan@suse.com> | |||||
Date: Tue, 19 Nov 2019 07:54:41 -0800 | |||||
Subject: [PATCH] Ignore iface.example in iface match checks | |||||
Just a cleanup, as looking at the example file | |||||
didn't hurt anything, but did waste our time. | |||||
--- | |||||
usr/iface.c | 3 +++ | |||||
1 file changed, 3 insertions(+) | |||||
diff --git a/usr/iface.c b/usr/iface.c | |||||
index 323f1675..11f3d2ac 100644 | |||||
--- a/usr/iface.c | |||||
+++ b/usr/iface.c | |||||
@@ -905,6 +905,9 @@ int iface_for_each_iface(void *data, int skip_def, int *nr_found, | |||||
!strcmp(iface_dent->d_name, "..")) | |||||
continue; | |||||
+ if (!strcmp(iface_dent->d_name, "iface.example")) | |||||
+ continue; | |||||
+ | |||||
log_debug(5, "iface_for_each_iface found %s", | |||||
iface_dent->d_name); | |||||
iface = iface_alloc(iface_dent->d_name, &err); |