david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/net
Michael Brown dbe84c5aad [iobuf] Add iob_disown() and use it where it simplifies code
There are many functions that take ownership of the I/O buffer they
are passed as a parameter.  The caller should not retain a pointer to
the I/O buffer.  Use iob_disown() to automatically nullify the
caller's pointer, e.g.:

    xfer_deliver_iob ( xfer, iob_disown ( iobuf ) );

This will ensure that iobuf is set to NULL for any code after the call
to xfer_deliver_iob().

iob_disown() is currently used only in places where it simplifies the
code, by avoiding an extra line explicitly setting the I/O buffer
pointer to NULL.  It should ideally be used with each call to any
function that takes ownership of an I/O buffer.  (The SSA
optimisations will ensure that use of iob_disown() gets optimised away
in cases where the caller makes no further use of the I/O buffer
pointer anyway.)

If gcc ever introduces an __attribute__((free)), indicating that use
of a function argument after a function call should generate a
warning, then we should use this to identify all applicable function
call sites, and add iob_disown() as necessary.
2009-02-01 20:16:10 +00:00
..
tcp [iobuf] Add iob_disown() and use it where it simplifies code 2009-02-01 20:16:10 +00:00
udp [iobuf] Add iob_disown() and use it where it simplifies code 2009-02-01 20:16:10 +00:00
aoe.c [aoe] Use an AoE config query to identify the target MAC address 2008-11-19 21:42:33 +00:00
arp.c [iobuf] Add iob_disown() and use it where it simplifies code 2009-02-01 20:16:10 +00:00
dhcpopts.c [Settings] Remove assumption that all settings have DHCP tag values 2008-03-25 20:46:16 +00:00
dhcppkt.c [dhcp] Split PXE menuing code out of dhcp.c 2009-02-01 01:21:40 +00:00
ethernet.c [ethernet] Fix eth_mc_hash() return status 2009-01-21 03:38:25 +00:00
fakedhcp.c [dhcp] Split PXE menuing code out of dhcp.c 2009-02-01 01:21:40 +00:00
icmpv6.c [tcpip] Allow for transmission to multicast IPv4 addresses 2009-01-21 03:40:39 +00:00
infiniband.c [infiniband] Call ib_open() only when opening the IPoIB net device 2009-01-02 21:04:31 +00:00
iobpad.c Rename pkbpad.c to iobpad.c 2007-05-19 18:42:27 +00:00
ipv4.c [tcpip] Allow for transmission to multicast IPv4 addresses 2009-01-21 03:40:39 +00:00
ipv6.c [tcpip] Allow for transmission to multicast IPv4 addresses 2009-01-21 03:40:39 +00:00
ndp.c Kill off some warnings-problematic debug statements in ndp.c; the code 2007-12-07 01:51:08 +00:00
netdev_settings.c [Settings] Remove assumption that all settings have DHCP tag values 2008-03-25 20:46:16 +00:00
netdevice.c [netdevice] Provide function to retrieve the most recently opened net device 2008-11-21 20:34:02 +00:00
nullnet.c Add per-file error identifiers 2007-07-24 17:11:31 +01:00
rarp.c Add untested support for UNDI transmit and receive. 2007-07-02 20:05:58 +01:00
retry.c [retry] Use a separate flag to indicate that a retry timer is running 2008-10-12 15:11:20 +01:00
tcp.c [tcp] Always set PUSH flag on TCP transmissions 2009-01-21 04:22:34 +00:00
tcpip.c [tcpip] Allow for transmission to multicast IPv4 addresses 2009-01-21 03:40:39 +00:00
tls.c [build] Keep gcc 4.4 happy 2008-11-18 01:52:40 +00:00
udp.c [iobuf] Add iob_disown() and use it where it simplifies code 2009-02-01 20:16:10 +00:00