summaryrefslogtreecommitdiffstats
path: root/src/net/fcels.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/fcels.c')
-rw-r--r--src/net/fcels.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/net/fcels.c b/src/net/fcels.c
index 63063ca35..fe2f5c224 100644
--- a/src/net/fcels.c
+++ b/src/net/fcels.c
@@ -119,15 +119,26 @@ static struct fc_els_handler * fc_els_detect ( struct fc_els *els,
* @ret rc Return status code
*/
int fc_els_tx ( struct fc_els *els, const void *data, size_t len ) {
- struct xfer_metadata meta = {
- .flags = ( fc_els_is_request ( els ) ?
- XFER_FL_OVER : ( XFER_FL_RESPONSE | XFER_FL_OUT ) ),
- };
+ union {
+ struct sockaddr sa;
+ struct sockaddr_fc fc;
+ } dest;
+ struct xfer_metadata meta;
int rc;
DBGC2 ( els, FCELS_FMT " transmitting:\n", FCELS_ARGS ( els ) );
DBGC2_HDA ( els, 0, data, len );
+ /* Construct metadata */
+ memset ( &dest, 0, sizeof ( dest ) );
+ dest.fc.sfc_family = AF_FC;
+ memcpy ( &dest.fc.sfc_port_id, &els->peer_port_id,
+ sizeof ( dest.fc.sfc_port_id ) );
+ memset ( &meta, 0, sizeof ( meta ) );
+ meta.flags = ( fc_els_is_request ( els ) ?
+ XFER_FL_OVER : ( XFER_FL_RESPONSE | XFER_FL_OUT ) );
+ meta.dest = &dest.sa;
+
/* Transmit frame */
if ( ( rc = xfer_deliver_raw_meta ( &els->xchg, data, len,
&meta ) ) != 0 ) {
@@ -524,6 +535,14 @@ static int fc_els_flogi_rx ( struct fc_els *els, const void *data,
return rc;
}
+ /* Send any responses to the newly-assigned peer port ID, if
+ * applicable.
+ */
+ if ( ! has_fabric ) {
+ memcpy ( &els->peer_port_id, &els->port->ptp_link_port_id,
+ sizeof ( els->peer_port_id ) );
+ }
+
return 0;
}