Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15624
b: refs/heads/master
c: 8a47cd3
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Dec 14, 2005
1 parent 2c6009a commit 32da819
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d841d6bd94d55642f8dbb11d6b672b3b50ff82e
refs/heads/master: 8a47cd340b4a299087f926ff2780d1eb08513f04
24 changes: 12 additions & 12 deletions trunk/drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
crypto_digest_digest(conn->rx_tfm, &sg, 1, (u8 *)&cdgst);
rdgst = *(uint32_t*)((char*)hdr + sizeof(struct iscsi_hdr) +
conn->in.ahslen);
if (cdgst != rdgst) {
printk(KERN_ERR "iscsi_tcp: itt %x: hdrdgst error "
"recv 0x%x calc 0x%x\n", conn->in.itt, rdgst,
cdgst);
return ISCSI_ERR_HDR_DGST;
}
}

/* save opcode for later */
Expand Down Expand Up @@ -610,13 +616,6 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
conn->in.ahslen, conn->in.datalen);

if (conn->in.itt < session->cmds_max) {
if (conn->hdrdgst_en && cdgst != rdgst) {
printk(KERN_ERR "iscsi_tcp: itt %x: hdrdgst error "
"recv 0x%x calc 0x%x\n", conn->in.itt, rdgst,
cdgst);
return ISCSI_ERR_HDR_DGST;
}

ctask = (struct iscsi_cmd_task *)session->cmds[conn->in.itt];

if (!ctask->sc) {
Expand Down Expand Up @@ -1128,8 +1127,7 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
*/
rc = iscsi_hdr_recv(conn);
if (!rc && conn->in.datalen) {
if (conn->datadgst_en &&
conn->in.opcode != ISCSI_OP_LOGIN_RSP) {
if (conn->datadgst_en) {
BUG_ON(!conn->data_rx_tfm);
crypto_digest_init(conn->data_rx_tfm);
}
Expand Down Expand Up @@ -1179,8 +1177,7 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
}
conn->in.copy -= conn->in.padding;
conn->in.offset += conn->in.padding;
if (conn->datadgst_en &&
conn->in.opcode != ISCSI_OP_LOGIN_RSP) {
if (conn->datadgst_en) {
if (conn->in.padding) {
debug_tcp("padding -> %d\n", conn->in.padding);
memset(pad, 0, conn->in.padding);
Expand Down Expand Up @@ -2875,8 +2872,11 @@ iscsi_conn_stop(iscsi_connh_t connh, int flag)
* in hdr_extract() and will be re-negotiated at
* set_param() time.
*/
if (flag == STOP_CONN_RECOVER)
if (flag == STOP_CONN_RECOVER) {
conn->hdr_size = sizeof(struct iscsi_hdr);
conn->hdrdgst_en = 0;
conn->datadgst_en = 0;
}
}
up(&conn->xmitsema);
}
Expand Down

0 comments on commit 32da819

Please sign in to comment.