[TIPC]: Implied connect now saves dest name for retrieval as ancillary data.
authorAllan Stephens <allan.stephens@windriver.com>
Mon, 26 Jun 2006 06:44:57 +0000 (23:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jun 2006 06:44:57 +0000 (23:44 -0700)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c

index 758b2d2d2f9cfe3b00527a85eec5f91f3bbfc741..98550b90a7305970e56ab06969a66e25f3e4b94c 100644 (file)
@@ -470,6 +470,10 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
                if ((tsock->p->published) ||
                    ((sock->type == SOCK_STREAM) && (total_len != 0)))
                        return -EOPNOTSUPP;
+               if (dest->addrtype == TIPC_ADDR_NAME) {
+                       tsock->p->conn_type = dest->addr.name.name.type;
+                       tsock->p->conn_instance = dest->addr.name.name.instance;
+               }
        }
 
        if (down_interruptible(&tsock->sem))
@@ -1269,10 +1273,6 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
           msg = buf_msg(buf);
            res = auto_connect(sock, tsock, msg);
            if (!res) {
-                  if (dst->addrtype == TIPC_ADDR_NAME) {
-                          tsock->p->conn_type = dst->addr.name.name.type;
-                          tsock->p->conn_instance = dst->addr.name.name.instance;
-                  }
                   if (!msg_data_sz(msg))
                           advance_queue(tsock);
           }