summaryrefslogtreecommitdiff
path: root/iscsiuio
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* iscsiuio: Release xmit_mutex in error code path.Manish Rangankar2018-08-141-0/+1
| | | | | | | This prevents iscsiuio seg fault in case get_tx_pkt fails while sending ARP. Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
* iscsiuio: Add inter-host mutex while doing xmitManish Rangankar2018-06-294-8/+51
| | | | | | | This avoids the netlink buffer corruption when more than one host try to xmit packet at the same time. Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
* Fix iscsiuio segfault when shutting down.Lee Duncan2018-05-311-1/+2
| | | | | | | If iscsiuio is stopped when first starting up, it can easily hit a window where pthread_cancel() is called before pthread_create() finishesx The problem was found by kiyo@jp.fujitsu.com, who also proposed the fix.
* Merge pull request #94 from gonzoleeman/gcc-8-fixesLee Duncan2018-03-221-1/+1
|\ | | | | Gcc 8 fixes -- clean up some string handling corner cases, and to make compiler happy
| * Use correct size when copying nic name.Lee Duncan2018-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The incorrect length was being used to copy the NIC name. Found by gcc-8, which gave this error: > [ 19s] nic_utils.c: In function 'nic_util_enable_disable_multicast': > [ 19s] nic_utils.c:308:9: warning: argument to 'sizeof' in 'strncpy' > call is the same expression as the source; did you mean to > use the size of the destination? [-Wsizeof-pointer-memaccess] > [ 19s] sizeof(nic->eth_device_name)); > [ 19s] ^
* | Merge pull request #89 from kraj/kraj/musl-fixesLee Duncan2018-03-222-2/+5
|\ \ | |/ |/| musl build fixes
| * bnx2x.c: Reorder the includes to avoid duplicate defines with muslKhem Raj2018-03-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | including nic.h before linux/ethtool.h avoids redefinitions of eth structs /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/ usr/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr' struct ethhdr { ^~~~~~ In file included from /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0. 876-r0/recipe-sysroot/usr/include/linux/ethtool.h:19:0, from qedi.c:52: /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/ usr/include/linux/if_ether.h:154:8: note: originally defined here struct ethhdr { ^~~~~~ Signed-off-by: Khem Raj <raj.khem@gmail.com>
| * qedi.c: Removed unused linux/ethtool.hKhem Raj2018-02-021-1/+0
| | | | | | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* | Merge pull request #91 from njavali/iscsiuio-bug-fixesLee Duncan2018-02-224-9/+43
|\ \ | |/ |/| Iscsiuio bug fixes
| * iscsiuio: v0.7.8.4Nilesh Javali2018-02-223-6/+41
| | | | | | | | Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
| * iscsiuio: allow ARP for non-matching src and dst addressesNilesh Javali2018-02-221-3/+2
| | | | | | | | | | | | | | | | | | For source and destination IP addresses in different networks, continue with the ARP retries and further login process instead of assuming abrupt failure. iSCSI offload adapters may not rely on netmask information for successful iSCSI target login. Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
* | Cleanup iscsiuio master Makefile template.Lee Duncan2018-01-171-4/+8
| | | | | | | | | | | | Make sure needed directories exist, and make sure install/symbolic linking of target works, even when not in root=/.
* | tell git to ignore the iscsiuio binaryLee Duncan2017-12-151-0/+1
| |