summaryrefslogtreecommitdiff
path: root/iscsiuio
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo error in iscsiuio/src/uip/lc-switch.h (#386)HEADmasterbaker9152022-12-241-1/+1
|
* iscsid/iscsiuio: fix OOM adjustment (#377)Lee Duncan2022-10-141-20/+28
| | | | | | | | | | | | | | | | | | | | | | * iscsid/iscsiuio: fix OOM adjustment For both the iscsid and iscsiuio daemons, they try to modify nice value and OOM adjustment value, so they have priority and will not be killed by the OOM-killer. But the code incorrectly set the value to "-17" for modern linux systems, when the maximum is actually "-1000". While making the changes, use "/proc/self/..." instead of "/proc/<PID>/...", so we don't have to use getpid() nor print out the pathname. Now we either write "-16" to the old interface, "-1000" to the new interface, or we print a warning. Several "log_debug()" calls that should have been warnings are changed to "log_warning()" calls in iscsid. * iscsid/iscsiuio: fix OOM adjustment value for older systems On older linux system, "-17" is the maximum, not "-16".
* Use meson as the main build system (#365)Lee Duncan2022-09-2111-6/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Build: Add an iscsiuio 'build_date.sh' script This is currently unused, but will be used by meson to build the "build_date.[ch]" files used by iscsiuio. * Build: have git ignore file '.setup' I commonly use this file for shell aliases/functions. * Add framework to support building using meson. This adds the ability to use meson/ninja to build open-iscsi and iscsiuio, rather than the current system that uses 'autoconf' for iscsiuio and uses 'make' for everything else. The old make/autoconf system is left in place, for now, but deprecated, including a warning about that when running 'make all' or 'make user' from the top-level. * utils/build: enhance iscsi-iname to generate prefix Added new "-g/--generate-iname-prefix" argument to generate the InitiatorName= prefix. Also, updated iscsi-iname to use getopts. Also, use the new option from meson. * git/meson: remove 'builddir' from ignored files The build directory can be called anything. Suggested by: Eli Schwartz * iscsiuio build: fix new build_date.sh script Fixed several issues: - fix option handling for "-S" - fix epoch date handling from env (noticed by Eli Schwartz) - remove debug statements * iscsiuio meson: warn when not creating a symlink for iscsiuio * meson: install man pages more efficiently We don't need to specify path or subdirectory * iscsiuio meson: remove unused source date epoch option This option was never used, since we pass this info from the environment. * meson: no need to set libdir: default is fine * iscsiuio meson: no need to add c_args: already there * Don't generate initiatorname when cross-building (#367) Let it be generated by the iscsi-init service. Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com> * Set ISCSI_CONFIG_ROOT by meson Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com> * Set LOCK_DIR from home_dir to lock_dir Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com> * Install iface.example to db_root/ifaces Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com> Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com> Co-authored-by: TIAN Yuanhao <78596099+tianyuanhao@users.noreply.github.com> Co-authored-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Small bug fixes (#364)Lee Duncan2022-09-063-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * build: move utils/sysdeps to top-level The routines here are used by iscsiuio, so move them to the top level. * libopeniscsiusr: fix kernel-doc bugs There were errors in four places, effecting the generated manual pages. * libopeniscsiusr: clean up kernel-doc usage Simplify generation of library interface documentation using the kernel-doc script: * make the kernel-doc perl script executble (the only visible change) * remove mention of sed (not used) * stop compressing man pages -- let distros do that * improve kernel-doc so that doc-preclean.pl and split-man.pl are no longer needed * add list-man-pages.sh to simplify things (copied from libnvme) * build: keep current version number in one place Move the current version number (now 2.1.7) into the top-level Makefile, and out of usr/version.h and libopeniscsiusr/version.h, completely eliminating the need for the latter. Note that this ties the libopeniscsiusr library idea of "version" to the usr/ (iscsid, etc) idea of version, even though they used to be defined separately. But they always had the same value, so nothing lost. * build: insteall man pages uncompressed We were delivering some man pages compressed and other not, and it turns out distros know how to install man pages using the compression they prefer, so stop doing it for them.
* iscsiuio: Use pthread_t for INVALID_THREAD (#363)Khem Raj2022-09-021-1/+1
| | | | | | | | pthread_t is opaque, therefore avoid compiler errors on musl when compiling since pthread_t is not a plain old data type, like glibc Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* iscsiuio: fix LDADDSam James2022-04-151-10/+7
| | | | | | | | | | - We don't want to use _LIBS here, we're building a library, not an executable. - We want LDADD for the whole lot (not a mix of LDFLAGS/LIBS/LDADD), but put the objects/libraries (.a files) first so that -l* works correctly. Closes: https://github.com/open-iscsi/open-iscsi/issues/337 Fixes: 9fbd6009cd917f1152a367fa7e5ae3993133c1e4 Signed-off-by: Sam James <sam@gentoo.org>
* Merge pull request #333 from thesamesam/masterLee Duncan2022-04-102-3/+4
|\ | | | | Build system tweaks from downstream
| * iscsiuio: respect LDFLAGS fullySam James2022-04-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | Use LIBS rather than LDFLAGS which ensures automake gets the ordering right (some LDFLAGS values won't work correctly if not placed exactly before libraries). This should functionally work the same as before, just improve compatibility with bits like -Wl,--as-needed. Signed-off-by: Sam James <sam@gentoo.org>
| * iscsiuio: don't clobber LDFLAGS in configure.acSam James2022-04-031-1/+1
| | | | | | | | | | | | | | | | | | The systemd check currently clobbers LDFLAGS from the environment rather than appending to it. But we actually want LIBS here anyway, rather than LDFLAGS. Signed-off-by: Sam James <sam@gentoo.org>
* | Merge pull request #330 from ryancaicse/masterLee Duncan2022-04-031-1/+1
|\ \ | | | | | | Fix a missing-unlocking bug
| * | Fix a missing-unlocking bugryancaicse2022-04-021-1/+1
| |/ | | | | Fix a missing-unlocking bug in nic_utils.c
* | Be smarter about creating iscsiuio.8 man pageLee Duncan2022-04-031-3/+7
|/ | | | | | | On install we created both usr/share/man/man8/iscsiuio.8 and usr/share/man/man8/iscsiuio.8.gz, since we installed from both iscsiuio/Makefile as well as from doc/Makefile, so get rid of the doc/Makefile version and just insall the gz from iscsiuio.
* Make DB and ISCSIHOME directories configurable.Lee Duncan2022-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | This commit adds two new top-level build options: one for the "home" directory for open-iscsi called "HOMEDIR", and one for the "database" directory, called "DBROOT". One can now override the defaults of "/etc/iscsi" for either or both of these directories on the make command line. The README and man pages are updated with details about these new options. Some Makefile cleanup/repair was done as well. Installation of the initiatorname.iscsi file, was moved out of the top-level Makefile into the etc subdirectory, and installation of man ages moved from the top-level Makefile to the doc subdirectory. Also, this fixes some issues from commit fd14dd8316b1 ("Clean p Makefile build system."), which incorrectly changed the DESTDIR ariable in the Makefiles. This current commit also fixes the top-level variable names for moving DBROOT and HOMEDIR.
* bnx2x.c: Re-initialize bp->version with baseline version.Manish Rangankar2021-07-092-3/+19
| | | | | | | | In case eth device failed to return correct version, then we will initialize bp->version with baseline instead of assigning unknown version number. Signed-off-by: Manish Rangankar <mrangankar@marvell.com>
* Avoid hardcoding pkg-config to fix cross buildHelmut Grohne2021-02-151-3/+14
| | | | Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982307
* check for TCP urgent pointer past end of frameChris Leech2020-12-181-5/+10
| | | | CVE-2020-17437
* check for u8 overflow when processing TCP optionsChris Leech2020-12-181-5/+15
| | | | CVE-2020-13988
* check for header length underflow during checksum calculationChris Leech2020-12-181-1/+7
| | | | CVE-2020-13987
* iscsiuio: Remove unused macro IFNAMSIZ defined in iscsid_ipc.cWenchao Hao2020-12-121-3/+0
| | | | | | | | | | | | IFNAMSIZ is not used in this file. IFNAMSIZ is a macro defined in net/if.h. Maybe this this macro is defined here to give it a self defined value rather than system pre-defined at beginning, while it seems the code reference the macro in this file is removed, so here we can remove it. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Wu Bo <wubo40@huawei.com>
* iscsiuio: Fix invalid parameter when call fstat()Wenchao Hao2020-12-122-0/+14
| | | | | | | | | | | Both qedi_open() and bnx2x_open() perform 15 times retry to make system call open() successful, while this retry mechanism can not make sure open() can execute successfully. So this patch verify return value of open(), if it is still INVALID_FD just print error info and return the errno. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
* Fix compiler complaint about string copy in iscsiuioLee Duncan2020-06-031-5/+15
| | | | | This makes the compiler happy when searching for uio%d sysfs directories.
* Fix a compiler complaint about writing one byteLee Duncan2020-06-031-1/+1
| | | | | | | | When playing with IPv6 IP addresses, which are described in C using a union, and the gcc-10 compiler didn't like that we were not specifying which member of the union we wanted to address of, when in fact all members have the same address. The fix is to be more explicit.
* Change include of <sys/poll.h> to <poll.h>Lee Duncan2020-04-021-1/+1
| | | | The proper local is <poll.h>.
* Fix 586 compiler issues.Lee Duncan2020-01-292-8/+15
| | | | | | | Now that "-Werror" is turned on, 32-bit x86 compile problems are fatal, so fix them. *Should* be no functional change.
* Updates to support gcc -fno-common option.Lee Duncan2020-01-282-3/+3
| | | | | | This meant cleaning up the definition of some global variables, so that they were only defined in one place and refered to as external elsewhere.
* Revert "Out-of-bounds read: Overrunning array of 8 2-byte elements"Chris Leech2020-01-201-1/+1
| | | | | | It's been reported that this breaks IPv6 discovery with qedi controllers This reverts commit af48f0d68db48cd492d0e27e046fc011be236fd3.
* Uninitialized scalar value rcChris Leech2019-10-311-1/+1
|
* Resource leak: Variable raw going out of scope leaks the storage it points to.Chris Leech2019-10-311-0/+1
|
* Out-of-bounds read: Overrunning array of 8 2-byte elementsChris Leech2019-10-311-1/+1
| | | | | This loop is executing 16 times (sizeof(struct ipv6_addr)) but then consumes 16-bits at a time (and moves ptr ahead two bytes).
* Resource leak: Handle variable fd going out of scope leaks the handle.Chris Leech2019-10-311-0/+1
|
* Out-of-bounds read: Overrunning array of 4 bytes at byte offset 7 by ↵Chris Leech2019-10-311-2/+2
| | | | dereferencing pointer
* Merge pull request #169 from njavali/iscsiuio-bug-fixesLee Duncan2019-07-024-21/+21
|\ | | | | iscsiuio bug fix
| * iscsiuio: update version to 0.7.8.6Nilesh Javali2019-06-273-6/+21
| | | | | | | | Signed-off-by: Nilesh Javali <njavali@marvell.com>
| * iscsiuio: allow processing of iscsid requests in DHCP failure conditionNilesh Javali2019-06-271-15/+0
| | | | | | | | | | | | | | | | | | | | | | In the event of DHCP failure, killing of enable_nic_thread did not process any iscsid requests leading to error, iscsistart: Could not broadcast to uIP after 5 tries and login failure to next active path. Do not kill enable_nic_thread and allow further processing of iscsid requests and performing login to next active path. Signed-off-by: Nilesh Javali <njavali@marvell.com>
* | Handle systemd disablement correctly in iscsiuioLee Duncan2019-06-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | Commit c1870ae6dddb7bc2dbdc750df68edbbe1a80763f added systemd support to iscsiuio, but it was not integrated with the autoconf script there, so this commit rectifies that. Now one can build without systemd support, from the top, using: $ make OPTFLAGS="... -DNO_SYSTEMD ... which now works for both iscsid and iscsiuio.
* | Add systemd support for iscsiuioLee Duncan2019-05-141-0/+8
| | | | | | | | | | | | | | | | Add in example socket and service files for iscsiuio, such that it can socket-activated, as is iscsid. Also, update main in iscsiuio to use sd_notify() when it is ready for business. All of the systemd code can be skipped if NO_SYSTEMD is defined when building.
* | Fix pipe notification codeLee Duncan2019-05-141-4/+6
| | | | | | | | | | | | | | Only send a message down the pipe if it is open, i.e. only in daemon (non-foreground) mode. Fixes: 9483ee87ceea3ec8816e6a39d93aee242e7e19d2
* | Improve daemon synchronization, fix err msgsLee Duncan2019-05-142-10/+31
| | | | | | | | | | | | | | | | | | Add a pipe from child to parent when running in the background (daemon mode), so that the parent does not exit until the child is ready for business, so that systemd does not send us work too early. Also, fix error messages, adding newlines where needed, and printing them to stderr.
* | Stop using /var directory for PIDfile and locksLee Duncan2019-05-142-2/+2
| | | | | | | | | | Convert /var/run to /run, and convert /var/lock to /run/lock, as per modern requirements on use of the /var directory.
* | Merge pull request #148 from njavali/iscsiuio-bug-fixesLee Duncan2018-11-265-9/+39
|\ \ | |/ | | iscsiuio bug fixes
| * iscsiuio: v0.7.8.5Nilesh Javali2018-11-203-6/+28
| | | | | | | | Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
| * qedi: Use uio BD index instead on buffer index.Manish Rangankar2018-11-201-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | 1. Use HW BD prod index to read packet buffer descriptor. 2. Use BD producer and consumer index to check for new data instead of UIO ring buffer index. NOTE - This patch has dependency on upstream qedi driver v8.33.0.21, commit "qedi: Move LL2 producer index processing in BH.", (https://marc.info/?l=linux-scsi&m=154271028608808) Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
| * qedi: Set buf_size in case of ICMP and ARP packet.Manish Rangankar2018-11-201-0/+2
| | | | | | | | | | | | Invalid ether len was resulting into showing CRC error on wire. Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
* | Merge pull request #144 from njavali/iscsiuio-bug-fixesLee Duncan2018-10-241-3/+6
|\ \ | |/ | | iscsiuio: Do not flush tx queue on each uio interrupt.
| * iscsiuio: Do not flush tx queue on each uio interrupt.Manish Rangankar2018-10-241-3/+6
| | | | | | | | | | | | | | | | Unlike bnx2x, qedi start_xmit netlink provide us guarantee of transmitting LL2 packet, so there is no need to call clear_tx_intr for each LL2 packet. This help us in reducing iscsiuio lock contention. Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
* | Merge pull request #129 from cpaelzer/cleanup-nic_nl_open-usageLee Duncan2018-09-262-3/+4
|\ \ | | | | | | Cleanup nic nl open usage
| * | iscsiuio: fail on nic_nl_open failingChristian Ehrhardt2018-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value of nic_nl_open was ignored and while working by chance being the latest call before the error label any later insertion of code after this might break it. Avoid that by checking for the retval and explicitly jumping to the error label in case it is non zero. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
| * | iscsiuio: avoid loosing bad rc in nic_nl_openChristian Ehrhardt2018-09-201-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | nic_nl_open might have collected a non-zero rc and jumped to the error label but still returned zero which would indicate success. The function should return whatever it has collected in rc and while working without, also explicitly initialize it to zero. Fixes #125 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
* | Close file handles when writing pid files.Scott Moser2018-09-191-1/+2
|/ | | | | | | The file descriptors used for writing to the pid file were not being closed. Just be more clean and close them. Also fix a debug message that said 'lock file' rather than 'pid file'.
* iscsiuio: limit retries of performing dhcpv6 before declaring dhcp failureNilesh Javali2018-08-241-3/+8
| | | | | | | | After successful stateless router adv., the restart of handle_ndp thread infinitely checks dhcpv6 causing IPv6 DHCP sequence failure. Limit the retries of dhcpv6 validation. Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>