david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

35 Commits

Author SHA1 Message Date
Michael Brown 91372d6dab [xfer] Ensure va_end() is called on failure path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:38:39 +02:00
Michael Brown 5e2a7481ad [xfer] Send intf_close() if redirection fails
A redirection failure is fatal, but provides no opportunity for the
caller of xfer_[v]redirect() to report the failure since the interface
will already have been disconnected.  Fix by sending intf_close() from
within the default xfer_vredirect() handler.

Debugged-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-07-04 16:14:46 +01:00
Michael Brown 0dc85aed03 [xfer] Add xfer_check_order() utility function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22 21:17:47 +01:00
Michael Brown 7194f38131 [xfer] Use intf_poke() to implement xfer_window_changed()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-22 21:17:47 +01:00
Michael Brown b6ee89ffb5 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
Relicense files for which I am the sole author (as identified by
util/relicense.pl).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 14:17:31 +00:00
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown de2616165b [xfer] Avoid using stack-allocated memory in xfer_printf()
xfer_printf() occasionally has to deal with strings that are
potentially long, such as HTTP URIs with multiple query parameters.
Allocating these on the stack can lead to stack overruns and memory
corruption.

Fix by using vasprintf() instead of a stack allocation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-23 20:30:48 +01:00
Michael Brown ba3633782b [xfer] Send xfer_window_changed() after xfer_vredirect()
Modify the default action for xfer_vredirect() to automatically send
xfer_window_changed() messages to both the new child and the parent
interfaces.  This will allow the elimination of processes that simply
poll on xfer_window() to determine when a redirection has completed
successfully.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-06-28 14:45:08 +01:00
Michael Brown c8199aacaa [xfer] Add xfer_window_changed()
xfer_window_changed() can be used to notify peers that an interface is
now ready to accept data.  This can potentially be used to eliminate
the need for wasteful processes that simply poll xfer_window() until
the window becomes non-zero.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:12:17 +01:00
Michael Brown 0329673833 [xfer] Add xfer_deliver_raw_meta()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:23:16 +01:00
Michael Brown 364b92521a [xfer] Generalise metadata "whence" field to "flags" field
iPXE has never supported SEEK_END; the usage of "whence" offers only
the options of SEEK_SET and SEEK_CUR and so is effectively a boolean
flag.  Further flags will be required to support additional metadata
required by the Fibre Channel network model, so repurpose the "whence"
field as a generic "flags" field.

xfer_seek() has always been used with SEEK_SET, so remove the "whence"
field altogether from its argument list.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:21:14 +01:00
Michael Brown 65bc070b05 [interface] Allow for non-pass-through interface methods
xfer_vredirect() should not be allowed to propagate to a pass-through
interface.  For example, when an HTTPS connection is opened, the
redirect message should cause the TLS layer to reopen the TCP socket,
rather than causing the HTTP layer to disconnect from the TLS layer.

Fix by allowing for non-pass-through interface methods, and setting
xfer_vredirect() to be one such method.

This is slightly ugly, in that it complicates the notion of an
interface method call by adding a "pass-through" / "non-pass-through"
piece of metadata.  However, the only current user of xfer_vredirect()
is iscsi.c, which uses it only because we don't yet have an
ioctl()-style call for retrieving the underlying socket address.
The new interface infrastructure allows for such a call to be created,
at which time this sole user of xfer_vredirect() can be removed,
xfer_vredirect() can cease to be an interface method and become simply
a wrapper around xfer_vreopen(), and the concept of a non-pass-through
interface method can be reverted.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-06-22 19:12:40 +01:00
Michael Brown 4327d5d39f [interface] Convert all data-xfer interfaces to generic interfaces
Remove data-xfer as an interface type, and replace data-xfer
interfaces with generic interfaces supporting the data-xfer methods.

Filter interfaces (as used by the TLS layer) are handled using the
generic pass-through interface capability.  A side-effect of this is
that deliver_raw() no longer exists as a data-xfer method.  (In
practice this doesn't lose any efficiency, since there are no
instances within the current codebase where xfer_deliver_raw() is used
to pass data to an interface supporting the deliver_raw() method.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-06-22 15:50:31 +01:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated
resources has been revoked by the registrant of the domain.  Work
around this problem by renaming project from gPXE to iPXE, and
updating URLs to match.

Also update README, LOG and COPYRIGHTS to remove obsolete information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:39 +01:00
Michael Brown b7e93a6a55 [xfer] Always nullify interface while sending close() message
Objects typically call xfer_close() as part of their response to a
close() message.  If the initiating object has already nullified the
xfer interface then this isn't a problem, but it can lead to
unexpected behaviour when the initiating object is aiming to reuse the
connection and so does not nullify the interface.

Fix by always temporarily nullifying the interface during xfer_close()
(as was already being done by xfer_vreopen() in order to work around
this specific problem).

Reported-by: infernix <infernix@infernix.net>
Tested-by: infernix <infernix@infernix.net>
2009-07-06 16:16:59 +01:00
Michael Brown c44a193d0d [legal] Add a selection of FILE_LICENCE declarations
Add FILE_LICENCE declarations to almost all files that make up the
various standard builds of gPXE.
2009-05-18 08:33:25 +01:00
Michael Brown 8ae1cac050 [xfer] Make consistent assumptions that xfer metadata can never be NULL
The documentation in xfer.h and xfer.c does not say that the metadata
parameter is optional in calls such as xfer_deliver_iob_meta() and the
deliver_iob() method.  However, some code in net/ is prepared to
accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer
directly to the deliver_iob() method.

Fix this mess of conflicting assumptions by making everything assume
that the metadata parameter is mandatory, and fixing
xfer_deliver_as_iob() to pass in a dummy metadata structure (as is
already done in xfer_deliver_iob()).
2009-02-15 08:44:22 +00:00
Michael Brown a2b4252d5a Add XFER_INIT() macro. 2008-01-22 18:48:47 +00:00
Michael Brown f6a8158eed Make seek information part of the xfer metadata, rather than an entirely
separate xfer method.

Add missing .alloc_iob entries to several xfer_interface_operations
structures.
2008-01-08 16:46:55 +00:00
Michael Brown 4075f7596b Unplug before sending close() message, to avoid screwing up interfaces
which respond to close with a reopen() (e.g. iSCSI).
2007-07-10 06:25:30 +01:00
Michael Brown f0c44f2f71 Remove xfer_ready() (it has been replaced by xfer_window()) 2007-07-09 03:58:46 +01:00
Michael Brown b34d4d0449 Separate the "is data ready" function of xfer_seek() into an
xfer_window() function, which can return a scalar rather than a
boolean.
2007-07-08 14:11:07 +01:00
Michael Brown ca4c6f9eee Kill off unused request() method in data-xfer interface. 2007-07-08 02:10:54 +01:00
Michael Brown 95adce0ce1 Add concept of transfer metadata, to be used by UDP in order to
implement sendto()/recvfrom() equivalents.
2007-06-11 15:04:39 +01:00
Michael Brown 6a5cc3533f Added missing va_end() 2007-06-03 02:11:25 +00:00
Michael Brown a6a18ae9af Add xfer_[v]printf() functions. 2007-05-28 20:09:44 +00:00
Michael Brown 10d0a1f8c7 Modify data-xfer semantics: it is no longer necessary to call one of
request(), seek() or deliver_xxx() in order to start the data flow.
Autonomous generators must be genuinely autonomous (having their own
process), or otherwise arrange to be called.  TCP does this by
starting the retry timer immediately.

Add some debugging statements.
2007-05-26 15:04:36 +00:00
Michael Brown b1755462ab Do not hold self-references. This then avoids the problem of having to
ensure that we only drop our self-reference exactly once.

To maintain the guarantee that an object won't go out of scope
unexpectedly while one of its event handlers is being called, the
event-calling functions now automatically obtain and drop extra
references.
2007-05-15 16:53:46 +00:00
Michael Brown 5471bfbbbe Data-transfer interface should now be functionally complete. 2007-05-15 15:23:09 +00:00
Michael Brown e3dcb9a1ad Add start() event
Add "xfer" to all xfer functions and "job" to all job functions.
2007-05-01 00:07:57 +00:00
Michael Brown d40761d725 Add (and use) generic reference counter, to improve signal:noise ratio
in code defining reference-counted objects.
2007-04-29 23:53:39 +00:00
Michael Brown 280160139d Add seek()
Dehyphenate "data-transfer".
2007-04-29 02:03:58 +00:00
Michael Brown ff1222a8d3 Preliminary support for opening data-transfer interfaces 2007-04-28 20:56:24 +00:00
Michael Brown 1c765b3988 Added deliver-as-iobuf/deliver-as-raw concepts. 2007-04-27 00:02:23 +00:00
Michael Brown 2575ddc889 Initial sketch for the generic data-transfer interface. 2007-04-26 22:44:52 +00:00