Michael Brown
1dcc60e5ad
[IPv4] Fix multicast address checking
...
From: Viswanath Krishnamurthy <viswa.krish@gmail.com>
The current ipv4 incorrectly checks the IP address for multicast address.
This causes valid IPv4 unicast address to be trated as multicast address
For e.g if the PXE/tftp server IP address is 192.168.4.XXX where XXX is
224 or greater, it gets treated as multicast address and a ethernet
multicast address is sent out on the wire causing timeouts
2008-05-19 16:19:46 +01:00
Michael Brown
92d15eff30
[Settings] Remove assumption that all settings have DHCP tag values
...
Allow for settings to be described by something other than a DHCP option
tag if desirable. Currently used only for the MAC address setting.
Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c.
Remove notion of settings from dhcppkt.c.
Rationalise dhcp.c to use settings API only for final registration of the
DHCP options, rather than using {store,fetch}_setting throughout.
2008-03-25 20:46:16 +00:00
Michael Brown
978865da2f
[IPv4] Use default netmasks when no subnet mask is specified.
2008-03-23 22:20:47 +00:00
Michael Brown
aec9b8a41b
[Settings] Use a settings applicator to configure IPv4 routes.
2008-03-21 00:01:27 +00:00
Michael Brown
df868476e7
Various warnings fixups for OpenBSD with gcc-3.3.5.
2007-12-07 00:11:43 +00:00
Holger Lubitz
6f0eca1400
use malloc attribute
2007-08-20 20:30:11 +02:00
Michael Brown
5b52630a9c
Never attempt to route the broadcast address.
2007-07-03 13:55:45 +01:00
Michael Brown
f77815f2b1
Kill off hotplug.h and just make net devices normal reference-counted
...
structures.
DHCP still broken and #if 0'd out.
2007-06-27 14:48:31 +01:00
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;'
2007-05-19 18:39:40 +00:00
Michael Brown
73b09ecba6
Use stdio.h instead of vsprintf.h
2007-01-19 01:13:12 +00:00
Michael Brown
5ff23aa406
Include stdlib.h rather than malloc.h
2007-01-18 20:06:03 +00:00
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.
2007-01-16 04:09:13 +00:00
Michael Brown
1a1fc23417
Improve debugging
2007-01-16 03:29:15 +00:00
Michael Brown
c953c1a1c3
Use -ENETUNREACH to mean "no reachable network device exists, don't bother
...
retrying".
2007-01-14 16:22:10 +00:00
Michael Brown
d9ba8f790b
Add route() function to display routing table.
2007-01-10 20:38:20 +00:00
Michael Brown
cc9b32c405
Remove uIP; we haven't used it for quite some time now.
2007-01-10 02:52:58 +00:00
Michael Brown
f008b77ba2
Allow an explicit network device to be specified for IP-layer
...
transmissions.
2007-01-10 02:25:11 +00:00
Michael Brown
98b6154c3e
Add "name" field to network device, to facilitate netdev commands.
2007-01-09 23:48:18 +00:00
Michael Brown
35b5e5d3f5
Minirouting table entries hold a persistent reference to a net_device.
2007-01-04 03:10:21 +00:00
Michael Brown
a0525a4ed3
Verify checksums on the RX datapath.
...
Simplify checksum generation on the TX datapath.
2007-01-03 20:48:52 +00:00
Michael Brown
285beeff7c
Tidy up debug messages
...
Move routing into a separate function
2007-01-03 16:39:11 +00:00
Michael Brown
718294553b
Fix compiler warning
2007-01-03 15:56:15 +00:00
Michael Brown
867c7aef59
iphdr->hlen includes the IP header, so truncate packet *before*
...
stripping the header. Also fix an htons/ntohs confusion.
2006-08-09 11:52:53 +00:00
Marty Connor
ee9ae8130a
Remove _PROTOCOL macros for gcc 3.2 compatibility
2006-08-09 04:42:14 +00:00
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.
2006-08-09 01:24:32 +00:00
Nikhil Chandru Rao
409f69a08a
Changed ipv4_dump() to consume only one line.
2006-08-08 22:26:35 +00:00
Michael Brown
68e33224ef
gcc3 compatibility: removed ARP_NET_PROTOCOL().
2006-08-08 17:44:25 +00:00
Nikhil Chandru Rao
d2bdf81505
Removed some bugs in TCP
2006-08-08 03:42:30 +00:00
Michael Brown
885a630ddf
Fix routing when a gateway exists. This should probably be split into
...
a separate function.
2006-08-07 17:51:19 +00:00
Nikhil Chandru Rao
6714ec745a
Minor corrections
2006-08-07 07:37:23 +00:00
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.
2006-08-02 00:02:21 +00:00
Nikhil Chandru Rao
c24546c70b
Minor changes to the network layer rx() functions
2006-08-01 20:27:26 +00:00
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).
2006-08-01 14:22:04 +00:00
Michael Brown
3a0e293123
Renamed tcpip_if.[ch] to tcpip.[ch]
2006-08-01 14:18:09 +00:00
Michael Brown
36c94eae78
Clarify hexiness of header length
2006-07-20 00:01:50 +00:00
Michael Brown
2c0eb6eb1d
Correct TCP/IP checksum generation.
2006-07-19 23:38:05 +00:00
Nikhil Chandru Rao
5f651f8622
Added fragment reassembly code
2006-06-30 08:52:03 +00:00
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.
2006-06-28 15:43:08 +00:00
Nikhil Chandru Rao
6e2c97b0c0
Added ipv4_pseudo_header structure
2006-06-28 09:59:27 +00:00
Nikhil Chandru Rao
41b399d672
Fixed endianness of 16- and 32- bit values
2006-06-28 09:10:35 +00:00
Michael Brown
35557914e3
Simplify ipv4_tx() by not having a separate "source" variable now that
...
we are constructing the IP header ourselves.
Formatting fix-ups (80 column limit is mandatory!)
2006-06-26 16:10:34 +00:00
Michael Brown
b49de73950
Factorise out common code
2006-06-26 16:01:24 +00:00
Michael Brown
e517a4771b
Split ipv6 functions out from ipv4.c
2006-06-26 15:33:46 +00:00
Michael Brown
e04ea505c9
Whitespace fixes
2006-06-26 13:45:24 +00:00
Nikhil Chandru Rao
90fbff8f34
added support for processing and transmitting without uIP
2006-06-25 05:16:54 +00:00
Michael Brown
8637834031
Made the temporary buffer part of the TCP senddata() API, to ease the
...
transition away from uIP.
Prepared ipv4.c for transition away from uIP.
2006-06-17 23:20:54 +00:00
Michael Brown
3c8aafa209
Simplify RX data path.
...
Kill off the static single net device and move to proper dynamic
registration (which we need with the new device model).
Break the (flawed) assumption that all network-layer protocols can use
ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP
protocol using ARP_NET_PROTOCOL() and provide a single method for checking
the existence of a local network-layer address.
2006-06-17 22:36:27 +00:00
Michael Brown
bbd9e28061
Simplify TX datapath.
2006-06-16 00:19:46 +00:00
Michael Brown
69b1f24a97
I have no idea how this ever worked before.
2006-05-27 13:43:56 +00:00
Michael Brown
592a5a99c8
Moved uIP and tcp.c from proto/ to net/
2006-04-30 01:16:37 +00:00