net/smc: cleanup of get vlan id
The vlan_id of the underlying CLC socket was retrieved two times during processing of the listen handshaking. Change this to get the vlan id one time in connect and in listen processing, and reuse the id. And add a new CLC DECLINE return code for the case when the retrieval of the vlan id failed. Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

zatwierdzone przez
David S. Miller

rodzic
bc36d2fc93
commit
fba7e8ef51
@@ -699,9 +699,10 @@ static int __smc_connect(struct smc_sock *smc)
|
||||
if (using_ipsec(smc))
|
||||
return smc_connect_decline_fallback(smc, SMC_CLC_DECL_IPSEC);
|
||||
|
||||
/* check for VLAN ID */
|
||||
/* get vlan id from IP device */
|
||||
if (smc_vlan_by_tcpsk(smc->clcsock, &ini))
|
||||
return smc_connect_decline_fallback(smc, SMC_CLC_DECL_CNFERR);
|
||||
return smc_connect_decline_fallback(smc,
|
||||
SMC_CLC_DECL_GETVLANERR);
|
||||
|
||||
/* check if there is an ism device available */
|
||||
if (!smc_check_ism(smc, &ini) &&
|
||||
@@ -1267,6 +1268,12 @@ static void smc_listen_work(struct work_struct *work)
|
||||
return;
|
||||
}
|
||||
|
||||
/* get vlan id from IP device */
|
||||
if (smc_vlan_by_tcpsk(new_smc->clcsock, &ini)) {
|
||||
smc_listen_decline(new_smc, SMC_CLC_DECL_GETVLANERR, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&smc_server_lgr_pending);
|
||||
smc_close_init(new_smc);
|
||||
smc_rx_init(new_smc);
|
||||
|
Reference in New Issue
Block a user