summaryrefslogtreecommitdiffstats
path: root/src/net/ethernet.c
diff options
context:
space:
mode:
authorMichael Brown2009-10-23 23:14:05 +0200
committerMichael Brown2009-10-23 23:14:05 +0200
commit1b1e63d54d7697c1fd156dcf365e74c7836d4d37 (patch)
treef582b2ffbd80ebc45c97b6f0ac27a9d6f4d8ef8c /src/net/ethernet.c
parent[iscsi] Fix printing of non-existent strings in iBFT debug messages (diff)
downloadipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.tar.gz
ipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.tar.xz
ipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.zip
[netdevice] Add the concept of an "Ethernet-compatible" MAC address
The iBFT is Ethernet-centric in providing only six bytes for a MAC address. This is most probably an indirect consequence of a similar design flaw in the Windows NDIS stack. (The WinOF IPoIB stack performs all sorts of contortions in order to pretend to the NDIS layer that it is dealing with six-byte MAC addresses.) There is no sensible way in which to extend the iBFT without breaking compatibility with programs that expect to parse it. Add the notion of an "Ethernet-compatible" MAC address to our link layer abstraction, so that link layers can provide their own workarounds for this limitation.
Diffstat (limited to 'src/net/ethernet.c')
-rw-r--r--src/net/ethernet.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/ethernet.c b/src/net/ethernet.c
index e8daf9f9..79ed1dc6 100644
--- a/src/net/ethernet.c
+++ b/src/net/ethernet.c
@@ -148,6 +148,17 @@ int eth_mc_hash ( unsigned int af, const void *net_addr, void *ll_addr ) {
}
}
+/**
+ * Generate Ethernet-compatible compressed link-layer address
+ *
+ * @v ll_addr Link-layer address
+ * @v eth_addr Ethernet-compatible address to fill in
+ */
+int eth_eth_addr ( const void *ll_addr, void *eth_addr ) {
+ memcpy ( eth_addr, ll_addr, ETH_ALEN );
+ return 0;
+}
+
/** Ethernet protocol */
struct ll_protocol ethernet_protocol __ll_protocol = {
.name = "Ethernet",
@@ -160,6 +171,7 @@ struct ll_protocol ethernet_protocol __ll_protocol = {
.init_addr = eth_init_addr,
.ntoa = eth_ntoa,
.mc_hash = eth_mc_hash,
+ .eth_addr = eth_eth_addr,
};
/**