Commit Graph

19 Commits

Author SHA1 Message Date
Peter Lieven
423b82efa4 pdu: check callback for NULL everywhere
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-02 13:55:13 +02:00
Ronnie Sahlberg
99a5f99527 Add some emacs defaults. Tabs are 8 spaces.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-18 21:34:43 -08:00
Peter Lieven
47ea729d08 discovery: set cmdsn in discovery pdu
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-04-07 21:55:36 +02:00
Ronnie Sahlberg
44c5089a21 discovery.c: drop discovery requests on reconnect instead or re-queuing them
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-02-23 20:31:25 -08:00
Ronnie Sahlberg
511c2fdbd1 pdu.c: remove iscsi_allocate_pdu_with_itt_flags()
Remove iscsi_allocate_pdu() which is just a wrapper.
Rename iscsi_allocate_pdu_with_itt_flags() to iscsi_allocate_pdu()
and update all callers.

This only removes a wrapper function and contains no logic changes.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-02-23 20:26:22 -08:00
Michael Tokarev
d7ab603ba0 format string cast ptrdiff on 32bit arch (#747262)
Cast ptrdiff (diff between two pointers) to long to fix printfs.
This fixes FTBFS on 32bit architectures.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-05-07 06:49:02 -07:00
Ronnie Sahlberg
354f00fd4f Discovery: Create a list of portals for each discovered target.
Some targets return multiple TargetAddress for individual targets.
Create a linked list of addresses for each target instead of
failing the discovery process when this happens.
2014-01-15 19:37:40 -08:00
Michael Tokarev
120b308741 Spelling fixes: Dont => Don't
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-12-16 18:19:24 -08:00
Paolo Bonzini
34b93c4cfd fix CHAP authentication
Empty discovery and login packets are legal, and have the same behavior
as packets with a single NUL in them.  Introduced by commit 94d73fc
(Merge pull request #83 from bonzini/coverity, 2013-11-05).

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-12-12 17:06:06 +01:00
Paolo Bonzini
87ee645621 check for a target being there before processing TargetAddress
Otherwise we access a NULL pointer.  RFC3270 appendix D confirms
that TargetName must always come before TargetAddress.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 15:38:38 +01:00
Paolo Bonzini
bfde497565 rework login and discovery code to avoid strlen beyond end of data
Checking for the presence of the NUL character should be done
without accessing beyond the PDU datain.  Use memchr instead
of strlen, and compute the length only if a NUL character is
actually there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:32:34 +01:00
Ronnie Sahlberg
402653b9f3 portability updates
add check if ipv6/sockaddr_in6 is availavble or not
add check for poll.h and only include when available
add includes for AROS
2013-04-18 19:43:36 -07:00
Peter Lieven
d327ab09c6 MEMORY add wrappers around all mallocs and frees and trace them
This patch adds a wrapper around all memory allocations and frees.
The idea is to get warned immediately if the application leaks memory.
Additionally the wrapper functions make it easy to add different
memory allocators or memory pools in the future.
2012-11-03 01:05:57 +01:00
Ronnie Sahlberg
c3d3123981 Windows: Add support to build as a DLL under windows 2011-08-31 13:12:30 +10:00
Ronnie Sahlberg
9ddce8dc24 Replace bzero() with memset() 2011-01-03 15:35:36 +11:00
Ronnie Sahlberg
1c024d6bc4 Input processing:
Input processing used to keep all data in one single input buffer, which
makes it hard to handle nested events as well as reading directly from the
socket into the application buffer without an extra copy.

Create a new iscsi_in_pdu structure where we store the header, and any data
for the recevied pdu and store them in a proper input queue.

Change the signature for all processing functions to tahe a iscsi_in_pdu
structure for the received pdu instead of just a pointer to a buffer.
2010-12-11 15:15:51 +11:00
Ronnie Sahlberg
8a6665a092 Licence
Change to LGPL 2.1+ to be compatible with kvm/qemu
2010-12-11 11:47:28 +11:00
Ronnie Sahlberg
709d85c4da Add a COPYING file and updat ehte LGPL boilerplate 2010-12-05 11:11:37 +11:00
Ronnie Sahlberg
098bc5a9a7 Initial import of libiscsi 2010-12-05 08:24:57 +11:00