|
@@ -119,15 +119,26 @@ static struct fc_els_handler * fc_els_detect ( struct fc_els *els,
|
119
|
119
|
* @ret rc Return status code
|
120
|
120
|
*/
|
121
|
121
|
int fc_els_tx ( struct fc_els *els, const void *data, size_t len ) {
|
122
|
|
- struct xfer_metadata meta = {
|
123
|
|
- .flags = ( fc_els_is_request ( els ) ?
|
124
|
|
- XFER_FL_OVER : ( XFER_FL_RESPONSE | XFER_FL_OUT ) ),
|
125
|
|
- };
|
|
122
|
+ union {
|
|
123
|
+ struct sockaddr sa;
|
|
124
|
+ struct sockaddr_fc fc;
|
|
125
|
+ } dest;
|
|
126
|
+ struct xfer_metadata meta;
|
126
|
127
|
int rc;
|
127
|
128
|
|
128
|
129
|
DBGC2 ( els, FCELS_FMT " transmitting:\n", FCELS_ARGS ( els ) );
|
129
|
130
|
DBGC2_HDA ( els, 0, data, len );
|
130
|
131
|
|
|
132
|
+ /* Construct metadata */
|
|
133
|
+ memset ( &dest, 0, sizeof ( dest ) );
|
|
134
|
+ dest.fc.sfc_family = AF_FC;
|
|
135
|
+ memcpy ( &dest.fc.sfc_port_id, &els->peer_port_id,
|
|
136
|
+ sizeof ( dest.fc.sfc_port_id ) );
|
|
137
|
+ memset ( &meta, 0, sizeof ( meta ) );
|
|
138
|
+ meta.flags = ( fc_els_is_request ( els ) ?
|
|
139
|
+ XFER_FL_OVER : ( XFER_FL_RESPONSE | XFER_FL_OUT ) );
|
|
140
|
+ meta.dest = &dest.sa;
|
|
141
|
+
|
131
|
142
|
/* Transmit frame */
|
132
|
143
|
if ( ( rc = xfer_deliver_raw_meta ( &els->xchg, data, len,
|
133
|
144
|
&meta ) ) != 0 ) {
|
|
@@ -524,6 +535,14 @@ static int fc_els_flogi_rx ( struct fc_els *els, const void *data,
|
524
|
535
|
return rc;
|
525
|
536
|
}
|
526
|
537
|
|
|
538
|
+ /* Send any responses to the newly-assigned peer port ID, if
|
|
539
|
+ * applicable.
|
|
540
|
+ */
|
|
541
|
+ if ( ! has_fabric ) {
|
|
542
|
+ memcpy ( &els->peer_port_id, &els->port->ptp_link_port_id,
|
|
543
|
+ sizeof ( els->peer_port_id ) );
|
|
544
|
+ }
|
|
545
|
+
|
527
|
546
|
return 0;
|
528
|
547
|
}
|
529
|
548
|
|