mirror of https://github.com/ipxe/ipxe.git
Put in a method to get the MAC address for the AoE target. (It's not
elegant, but it works).pull/1/head
parent
99ef98d0bf
commit
f6d20bb0f4
|
@ -188,6 +188,7 @@ static int aoe_rx_response ( struct aoe_session *aoe, struct aoehdr *aoehdr,
|
||||||
static int aoe_rx ( struct pk_buff *pkb ) {
|
static int aoe_rx ( struct pk_buff *pkb ) {
|
||||||
struct aoehdr *aoehdr = pkb->data;
|
struct aoehdr *aoehdr = pkb->data;
|
||||||
unsigned int len = pkb_len ( pkb );
|
unsigned int len = pkb_len ( pkb );
|
||||||
|
struct ethhdr *ethhdr = pkb_push ( pkb, sizeof ( *ethhdr ) );
|
||||||
struct aoe_session *aoe;
|
struct aoe_session *aoe;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
@ -213,9 +214,8 @@ static int aoe_rx ( struct pk_buff *pkb ) {
|
||||||
continue;
|
continue;
|
||||||
if ( ntohl ( aoehdr->tag ) != aoe->tag )
|
if ( ntohl ( aoehdr->tag ) != aoe->tag )
|
||||||
continue;
|
continue;
|
||||||
|
memcpy ( aoe->target, ethhdr->h_source,
|
||||||
#warning "Need a way to get the MAC address for future reference"
|
sizeof ( aoe->target ) );
|
||||||
|
|
||||||
rc = aoe_rx_response ( aoe, aoehdr, len );
|
rc = aoe_rx_response ( aoe, aoehdr, len );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -235,11 +235,21 @@ static int aoe_rx ( struct pk_buff *pkb ) {
|
||||||
*/
|
*/
|
||||||
static int aoe_route ( const struct pk_buff *pkb __unused,
|
static int aoe_route ( const struct pk_buff *pkb __unused,
|
||||||
struct net_header *nethdr ) {
|
struct net_header *nethdr ) {
|
||||||
|
struct aoehdr *aoehdr = pkb->data;
|
||||||
|
struct aoe_session *aoe;
|
||||||
|
|
||||||
#warning "Need a way to find out the MAC address"
|
list_for_each_entry ( aoe, &aoe_sessions, list ) {
|
||||||
nethdr->flags = PKT_FL_BROADCAST;
|
if ( ( ntohs ( aoehdr->major ) == aoe->major ) &&
|
||||||
|
( aoehdr->minor == aoe->minor ) ) {
|
||||||
|
nethdr->flags = PKT_FL_RAW_ADDR;
|
||||||
|
memcpy ( nethdr->dest_net_addr, aoe->target,
|
||||||
|
sizeof ( aoe->target ) );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -EHOSTUNREACH;
|
||||||
|
}
|
||||||
|
|
||||||
/** AoE protocol */
|
/** AoE protocol */
|
||||||
struct net_protocol aoe_protocol = {
|
struct net_protocol aoe_protocol = {
|
||||||
|
@ -257,6 +267,7 @@ NET_PROTOCOL ( aoe_protocol );
|
||||||
* @v aoe AoE session
|
* @v aoe AoE session
|
||||||
*/
|
*/
|
||||||
void aoe_open ( struct aoe_session *aoe ) {
|
void aoe_open ( struct aoe_session *aoe ) {
|
||||||
|
memset ( aoe->target, 0xff, sizeof ( aoe->target ) );
|
||||||
list_add ( &aoe->list, &aoe_sessions );
|
list_add ( &aoe->list, &aoe_sessions );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue