diff options
author | Michael Brown | 2010-09-21 01:55:14 +0200 |
---|---|---|
committer | Michael Brown | 2010-09-21 03:06:06 +0200 |
commit | 654da534ada4624d20bd1e2835f86ee9c95ca165 (patch) | |
tree | d0c9868837954947d3ff034d7d1a2870f3555536 /src/net/fc.c | |
parent | [lotest] Add loopback testing commands (diff) | |
download | ipxe-654da534ada4624d20bd1e2835f86ee9c95ca165.tar.gz ipxe-654da534ada4624d20bd1e2835f86ee9c95ca165.tar.xz ipxe-654da534ada4624d20bd1e2835f86ee9c95ca165.zip |
[fc] Allow FLOGI response to be sent to newly-assigned peer port ID
The response to a received FLOGI should probably be sent to the peer
port ID assigned as a result of the WWPN comparison.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/fc.c')
-rw-r--r-- | src/net/fc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net/fc.c b/src/net/fc.c index 63df3dad..33e13bda 100644 --- a/src/net/fc.c +++ b/src/net/fc.c @@ -428,6 +428,7 @@ static struct io_buffer * fc_xchg_alloc_iob ( struct fc_exchange *xchg, static int fc_xchg_tx ( struct fc_exchange *xchg, struct io_buffer *iobuf, struct xfer_metadata *meta ) { struct fc_port *port = xchg->port; + struct sockaddr_fc *dest = ( ( struct sockaddr_fc * ) meta->dest ); struct fc_frame_header *fchdr; unsigned int r_ctl; unsigned int f_ctl_es; @@ -484,7 +485,9 @@ static int fc_xchg_tx ( struct fc_exchange *xchg, struct io_buffer *iobuf, fchdr = iob_push ( iobuf, sizeof ( *fchdr ) ); memset ( fchdr, 0, sizeof ( *fchdr ) ); fchdr->r_ctl = r_ctl; - memcpy ( &fchdr->d_id, &xchg->peer_port_id, sizeof ( fchdr->d_id ) ); + memcpy ( &fchdr->d_id, + ( dest ? &dest->sfc_port_id : &xchg->peer_port_id ), + sizeof ( fchdr->d_id ) ); memcpy ( &fchdr->s_id, &port->port_id, sizeof ( fchdr->s_id ) ); fchdr->type = xchg->type; fchdr->f_ctl_es = f_ctl_es; |