Kaynağa Gözat

[fcp] Use EINVAL for URI parsing errors and EPROTO for protocol errors

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 yıl önce
ebeveyn
işleme
f5115f96f7
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4
    4
      src/net/fcp.c

+ 4
- 4
src/net/fcp.c Dosyayı Görüntüle

@@ -512,7 +512,7 @@ static int fcpcmd_recv_xfer_rdy ( struct fcp_command *fcpcmd,
512 512
 		DBGC ( fcpdev, "FCP %p xchg %04x received invalid transfer "
513 513
 		       "ready IU:\n", fcpdev, fcpcmd->xchg_id );
514 514
 		DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
515
-		rc = -EINVAL;
515
+		rc = -EPROTO;
516 516
 		goto done;
517 517
 	}
518 518
 	if ( ntohl ( xfer_rdy->offset ) != fcpcmd->offset ) {
@@ -521,7 +521,7 @@ static int fcpcmd_recv_xfer_rdy ( struct fcp_command *fcpcmd,
521 521
 		       "delivery (expected %zd, requested %d)\n",
522 522
 		       fcpdev, fcpcmd->xchg_id, fcpcmd->offset,
523 523
 		       ntohl ( xfer_rdy->offset ) );
524
-		rc = -EINVAL;
524
+		rc = -EPROTO;
525 525
 		goto done;
526 526
 	}
527 527
 	DBGC2 ( fcpdev, "FCP %p xchg %04x XFER_RDY [%08x,%08x)\n",
@@ -564,7 +564,7 @@ static int fcpcmd_recv_rsp ( struct fcp_command *fcpcmd,
564 564
 		DBGC ( fcpdev, "FCP %p xchg %04x received invalid response "
565 565
 		       "IU:\n", fcpdev, fcpcmd->xchg_id );
566 566
 		DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
567
-		rc = -EINVAL;
567
+		rc = -EPROTO;
568 568
 		goto done;
569 569
 	}
570 570
 	DBGC2 ( fcpdev, "FCP %p xchg %04x RSP stat %02x resid %08x flags %02x"
@@ -645,7 +645,7 @@ static int fcpcmd_recv_unknown ( struct fcp_command *fcpcmd,
645 645
 	       fcpdev, fcpcmd->xchg_id );
646 646
 	DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
647 647
 	free_iob ( iobuf );
648
-	return -EINVAL;
648
+	return -EPROTO;
649 649
 }
650 650
 
651 651
 /**

Loading…
İptal
Kaydet