Michael Brown
21e9e801e2
[udp] Avoid reusing auto-allocated ports after connection close.
This duplicates a fix made to tcp.c in commit
d5735c631c .
16 vuotta sitten
Michael Brown
aa160211c2
[udp] Verify local socket address (if specified) for UDP sockets
UDP sockets can be used for multicast, at which point it becomes
plausible that we could receive packets that aren't destined for us
but that still match on a port number.
16 vuotta sitten
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.
17 vuotta sitten
Michael Brown
df868476e7
Various warnings fixups for OpenBSD with gcc-3.3.5.
17 vuotta sitten
Michael Brown
423e9d72f3
udp_open_promisc() calls udp_open_common() with peer==NULL.
17 vuotta sitten
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.
17 vuotta sitten
Michael Brown
ca4c6f9eee
Kill off unused request() method in data-xfer interface.
17 vuotta sitten
Holger Lubitz
389c63d7c4
convert to zalloc
17 vuotta sitten
Michael Brown
5de837cc67
Mildly ugly hack to force correct linkage.
17 vuotta sitten
Michael Brown
07dc294de8
Update DHCP to use data-xfer interface (not yet tested).
17 vuotta sitten
Michael Brown
f77815f2b1
Kill off hotplug.h and just make net devices normal reference-counted
structures.
DHCP still broken and #if 0'd out.
17 vuotta sitten
Michael Brown
e381714c07
Partial migration of UDP to data-xfer interface. (Will not link at
present; DHCP is broken).
17 vuotta sitten
Michael Brown
3e2c6b6736
pkbuff->iobuf changeover
Achieved via Perl using:
perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \
-e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \
-e 's/pkb/iobuf/g; s/PKB/IOB/g;'
17 vuotta sitten
Anselm Martin Hoffmeister
ff5aac826a
hoffmeis: Fixing situation where absence of a newdata() handler for UDP
connections might break things. Only-sending applications like syslog()
do not need a newdata() handler, so added a check if that handler exists.
17 vuotta sitten
Michael Brown
f11da20f25
When a network device is specified to tcpip_tx() or it's children, treat
it as a fallback network device rather than an explicitly forced network
device.
Clear routing table entries before re-attempting DHCP.
18 vuotta sitten
Michael Brown
bcdb6fad3e
Improve debug messages
18 vuotta sitten
Michael Brown
753e156844
Allow udp_{send,sendto,sendto_via} to be called outside of the
udp_senddata() callback. This will simplify any UDP protocols that don't
need the temporary buffer.
18 vuotta sitten
Michael Brown
c821a7b20d
Add udp_sendto_via() to allow e.g. DHCP to transmit without first having
to set up dummy routing entries.
18 vuotta sitten
Michael Brown
f008b77ba2
Allow an explicit network device to be specified for IP-layer
transmissions.
18 vuotta sitten
Michael Brown
18e5353bed
Rename pkb_available() to pkb_tailroom() for consistency with Linux's
skb_tailroom(). Add pkb_headroom().
18 vuotta sitten
Michael Brown
20681d6168
Allow empty checksums on received packets
18 vuotta sitten
Michael Brown
94fc68895d
Improve consistency between TCP and UDP RX datapaths
18 vuotta sitten
Michael Brown
a0525a4ed3
Verify checksums on the RX datapath.
Simplify checksum generation on the TX datapath.
18 vuotta sitten
Michael Brown
88e38fa148
We don't actually have a stdio.h header file. Our printf() functions are
defined in vsprintf.h. (This may change, since vsprintf.h is a
non-standard name, but for now it's the one to use.)
There should be no need to include vsprintf.h just for DBG() statements,
since include/compiler.h forces it in for a debug build anyway.
18 vuotta sitten
Marty Connor
6ac78f6aff
added stdio.h to includes for DBG compilation
18 vuotta sitten
Marty Connor
ee9ae8130a
Remove _PROTOCOL macros for gcc 3.2 compatibility
18 vuotta sitten
Michael Brown
a3d508b648
Clarified packet ownership transfer between a few functions.
Added a large number of missing calls to free_pkb(). In the case of UDP,
no received packets were ever freed, which lead to memory exhaustion
remarkably quickly once pxelinux started up.
In general, any function with _rx() in its name which accepts a pk_buff
*must* either call free_pkb() or pass the pkb to another _rx() function
(e.g. the next layer up the stack). Since the UDP (and TCP) layers don't
pass packet buffers up to the higher-layer protocols (the
"applications"), they must free the packet buffer after calling the
application's newdata() method.
18 vuotta sitten
Michael Brown
eb24eece0e
Convert some trivial functions to static inlines.
18 vuotta sitten
Michael Brown
ffe0e24249
Make the UDP senddata() methods return a status code.
udp_connect() now follows the standard BSD sockets semantics and simply
sets the default address for outgoing packets; it doesn't filter incoming
packets.
18 vuotta sitten
Michael Brown
a0a872f7f1
Updated PXE UDP implementation to use the new Etherboot UDP API.
Updated PXE API dispatcher to use copy_{to,from}_user, and moved to
arch/i386 since the implementation is quite architecture-dependent.
(The individual PXE API calls can be largely
architecture-independent.)
18 vuotta sitten
Michael Brown
467e9627cc
Added features that will be required for PXE UDP support.
Introduced struct sockaddr_tcpip, to simplify code that deals with
both IPv4 and IPv6 addresses.
Reorganised parts of tcpip.c and udp.c.
18 vuotta sitten
Michael Brown
1ebb68e49a
Renamed trans_{rx,tx}() to tcpip_{rx,tx}(), since they are specific to
the TCP/IP protocol suite (rather than being general transport-layer
functions).
18 vuotta sitten
Michael Brown
3a0e293123
Renamed tcpip_if.[ch] to tcpip.[ch]
18 vuotta sitten
Michael Brown
21c3d63c2e
We shouldn't need to allocate a TX packet buffer when calling newdata();
if the application wants to send data then it will have to use the normal
senddata() mechanism.
18 vuotta sitten
Michael Brown
29b358dd39
conn->local_port is now network-endian; do not swap when comparing
against value in header.
Temporarily disable RX checksumming; it's broken and is holding up
work on higher-layer protocols
.
18 vuotta sitten
Michael Brown
2c0eb6eb1d
Correct TCP/IP checksum generation.
18 vuotta sitten
Nikhil Chandru Rao
13dbf5494d
Minor edits
18 vuotta sitten
Michael Brown
a38010fb0e
Make udp_send() call udp_sendto(), rather than vice-versa.
18 vuotta sitten
Michael Brown
7c84b74185
A small but very critical bug.
18 vuotta sitten
Michael Brown
82f3295794
Use more standardised format specifiers in debug messages (e.g. %p for
a pointer).
18 vuotta sitten
Michael Brown
ab633f6a73
Reserve space for lower-layer headers when allocating packet buffer.
Use pkb_available() rather than pkb_len() (which will always return 0
on a freshly allocated buffer).
udp_send() should assume that the buffer has already been allocated.
18 vuotta sitten
Nikhil Chandru Rao
bf515d3d65
Minor edit in net/udp.c
18 vuotta sitten
Nikhil Chandru Rao
ab577e1a3a
The following edits were made: \
1. Updated UDP send data code\
2. Corrected internet checksum\
3. Moved udp_buffer() and udp_buflen() to udp.c from udp.h
18 vuotta sitten
Nikhil Chandru Rao
5f651f8622
Added fragment reassembly code
18 vuotta sitten
Nikhil Chandru Rao
c9ea710930
Renamed net/interface.c and include/gpxe/interface.h to net/tcpip_if.c and include/gpxe/tcpip_if.h respectively. Made changes in the other files.
18 vuotta sitten
Nikhil Chandru Rao
a6c6b3d739
Fixed whitespaces; updated UDP code
18 vuotta sitten
Nikhil Chandru Rao
74339b3c6e
updated UDP interface
18 vuotta sitten