On 10/27/2016 05:03 PM, Eric Dumazet wrote:
On Thu, 2016-10-27 at 16:22 +0200, Parthasarathy Bhuvaragan wrote:
In this commit, we create a new tipc socket state TIPC_DISCONNECTING in
sk_state. TIPC_DISCONNECTING is replacing the socket connection status
update using SS_DISCONNECTING.
TIPC_DISCONNECTING is set for connection oriented sockets at:
- tipc_shutdown()
- connection probe timeout
- when we receive an error message on the connection.

There is no functional change in this commit.

Acked-by: Ying Xue <ying....@windriver.com>
Acked-by: Jon Maloy <jon.ma...@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvara...@ericsson.com>
---
 include/uapi/linux/tipc.h |  1 +
 net/tipc/socket.c         | 39 +++++++++++++++++++++++----------------
 2 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h
index ae45de5e0d93..f5c03fdfc8a8 100644
--- a/include/uapi/linux/tipc.h
+++ b/include/uapi/linux/tipc.h
@@ -184,6 +184,7 @@ enum {
        TIPC_PROBING,
        TIPC_ESTABLISHED,
        TIPC_OPEN,
+       TIPC_DISCONNECTING,
 };


Note that all these TIPC socket states might conflict with
sk_fullsock(), sk_listener(), inet6_sk(), ip_skb_dst_mtu(),
sk_const_to_full_sk() , skb_to_full_sk() helpers.

So there is definitely a high risk.


Eric, i can map the tipc state to a corresponding tcp state like the patch below. This resembles the way its done in l2tp and sctp.
Do you see any issue with that?

diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h
index f2d9294d0920..e697f809549e 100644
--- a/include/uapi/linux/tipc.h
+++ b/include/uapi/linux/tipc.h
@@ -180,15 +180,17 @@ struct tipc_event {
  *     Definitions for the TIPC protocol sk_state field.
  */
 enum {
-       TIPC_LISTEN = 1,
-       TIPC_PROBING,
-       TIPC_ESTABLISHED,
-       TIPC_OPEN,
-       TIPC_DISCONNECTING,
-       TIPC_CLOSING,
-       TIPC_CONNECTING,
+       TIPC_LISTEN = TCP_LISTEN,
+       TIPC_ESTABLISHED = TCP_ESTABLISHED,
+       TIPC_CLOSE = TCP_CLOSE,
+       TIPC_CONNECTING = TCP_SYN_SENT,
+       TIPC_DISCONNECTING = TCP_CLOSE_WAIT,
 };

I will deleted TIPC_OPEN and TIPC_PROBING, the former can be set to TIPC_CLOSE like its done in tcp and the later can be replaced this with a probes_out counter.

/Partha

Reply via email to