summaryrefslogtreecommitdiffstats
path: root/net/smc/af_smc.c
diff options
context:
space:
mode:
authorKarsten Graul2019-04-12 12:57:27 +0200
committerDavid S. Miller2019-04-12 19:50:56 +0200
commitfba7e8ef513ce7309d62eb4999b640100b6db06f (patch)
tree290adf22a7dfa7e9f704c64a8a62072e9cec0d70 /net/smc/af_smc.c
parentnet/smc: consolidate function parameters (diff)
downloadkernel-qcow2-linux-fba7e8ef513ce7309d62eb4999b640100b6db06f.tar.gz
kernel-qcow2-linux-fba7e8ef513ce7309d62eb4999b640100b6db06f.tar.xz
kernel-qcow2-linux-fba7e8ef513ce7309d62eb4999b640100b6db06f.zip
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>
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r--net/smc/af_smc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index b45372879a70..8ec971f6d828 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -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);