aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/cnic.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 1240deaf2420..36c1578a1b1e 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -322,6 +322,8 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
322 return 0; 322 return 0;
323} 323}
324 324
325static void cnic_cm_upcall(struct cnic_local *, struct cnic_sock *, u8);
326
325static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type, 327static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
326 char *buf, u16 len) 328 char *buf, u16 len)
327{ 329{
@@ -351,7 +353,9 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
351 } 353 }
352 csk = &cp->csk_tbl[l5_cid]; 354 csk = &cp->csk_tbl[l5_cid];
353 csk_hold(csk); 355 csk_hold(csk);
354 if (cnic_in_use(csk)) { 356 if (cnic_in_use(csk) &&
357 test_bit(SK_F_CONNECT_START, &csk->flags)) {
358
355 memcpy(csk->ha, path_resp->mac_addr, 6); 359 memcpy(csk->ha, path_resp->mac_addr, 6);
356 if (test_bit(SK_F_IPV6, &csk->flags)) 360 if (test_bit(SK_F_IPV6, &csk->flags))
357 memcpy(&csk->src_ip[0], &path_resp->src.v6_addr, 361 memcpy(&csk->src_ip[0], &path_resp->src.v6_addr,
@@ -359,8 +363,16 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
359 else 363 else
360 memcpy(&csk->src_ip[0], &path_resp->src.v4_addr, 364 memcpy(&csk->src_ip[0], &path_resp->src.v4_addr,
361 sizeof(struct in_addr)); 365 sizeof(struct in_addr));
362 if (is_valid_ether_addr(csk->ha)) 366
367 if (is_valid_ether_addr(csk->ha)) {
363 cnic_cm_set_pg(csk); 368 cnic_cm_set_pg(csk);
369 } else if (!test_bit(SK_F_OFFLD_SCHED, &csk->flags) &&
370 !test_bit(SK_F_OFFLD_COMPLETE, &csk->flags)) {
371
372 cnic_cm_upcall(cp, csk,
373 L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
374 clear_bit(SK_F_CONNECT_START, &csk->flags);
375 }
364 } 376 }
365 csk_put(csk); 377 csk_put(csk);
366 rcu_read_unlock(); 378 rcu_read_unlock();