summaryrefslogtreecommitdiffstats
path: root/src/net/ipv4.c
diff options
context:
space:
mode:
authorMichael Brown2010-10-07 17:03:16 +0200
committerMichael Brown2010-10-07 20:15:04 +0200
commit88dd921e24af0893734d4e197d646cfc7732ed54 (patch)
tree8ecbe7ef1e5d84b2243894769a9ab1251d5c56de /src/net/ipv4.c
parent[int13] Fix typo in debug message (diff)
downloadipxe-88dd921e24af0893734d4e197d646cfc7732ed54.tar.gz
ipxe-88dd921e24af0893734d4e197d646cfc7732ed54.tar.xz
ipxe-88dd921e24af0893734d4e197d646cfc7732ed54.zip
[netdevice] Pass both link-layer addresses in net_tx() and net_rx()
FCoE requires the use of fabric-provided MAC addresses, which breaks the assumption that the net device's MAC address is implicitly the source address for net_tx() and the (unicast) destination address for net_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/ipv4.c')
-rw-r--r--src/net/ipv4.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/ipv4.c b/src/net/ipv4.c
index 5918bbec..f6a1e6e0 100644
--- a/src/net/ipv4.c
+++ b/src/net/ipv4.c
@@ -355,7 +355,8 @@ static int ipv4_tx ( struct io_buffer *iobuf,
ntohs ( iphdr->ident ), ntohs ( iphdr->chksum ) );
/* Hand off to link layer */
- if ( ( rc = net_tx ( iobuf, netdev, &ipv4_protocol, ll_dest ) ) != 0 ) {
+ if ( ( rc = net_tx ( iobuf, netdev, &ipv4_protocol, ll_dest,
+ netdev->ll_addr ) ) != 0 ) {
DBG ( "IPv4 could not transmit packet via %s: %s\n",
netdev->name, strerror ( rc ) );
return rc;
@@ -373,12 +374,15 @@ static int ipv4_tx ( struct io_buffer *iobuf,
*
* @v iobuf I/O buffer
* @v netdev Network device
+ * @v ll_dest Link-layer destination address
* @v ll_source Link-layer destination source
*
* This function expects an IP4 network datagram. It processes the headers
* and sends it to the transport layer.
*/
-static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused,
+static int ipv4_rx ( struct io_buffer *iobuf,
+ struct net_device *netdev __unused,
+ const void *ll_dest __unused,
const void *ll_source __unused ) {
struct iphdr *iphdr = iobuf->data;
size_t hdrlen;