aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2006-06-25 23:45:24 -0700
committerDavid S. Miller <davem@davemloft.net>2006-06-25 23:45:24 -0700
commit3546c7508d7e97fd855f8ac37afdd09622fa5ce1 (patch)
treebd7dcdbbb83244a4e06c06449d3fdbc965e1d118 /net
parent3388007bc4d662e50c2c01a7fb1fa2c31cea98ad (diff)
downloadkernel_samsung_smdk4412-3546c7508d7e97fd855f8ac37afdd09622fa5ce1.tar.gz
kernel_samsung_smdk4412-3546c7508d7e97fd855f8ac37afdd09622fa5ce1.tar.bz2
kernel_samsung_smdk4412-3546c7508d7e97fd855f8ac37afdd09622fa5ce1.zip
[TIPC]: Can now return destination name of form {0,x,y} via ancillary data.
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>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/socket.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 98550b90a73..361dc342f37 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -731,6 +731,7 @@ static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
u32 anc_data[3];
u32 err;
u32 dest_type;
+ int has_name;
int res;
if (likely(m->msg_controllen == 0))
@@ -755,24 +756,27 @@ static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
dest_type = msg ? msg_type(msg) : TIPC_DIRECT_MSG;
switch (dest_type) {
case TIPC_NAMED_MSG:
+ has_name = 1;
anc_data[0] = msg_nametype(msg);
anc_data[1] = msg_namelower(msg);
anc_data[2] = msg_namelower(msg);
break;
case TIPC_MCAST_MSG:
+ has_name = 1;
anc_data[0] = msg_nametype(msg);
anc_data[1] = msg_namelower(msg);
anc_data[2] = msg_nameupper(msg);
break;
case TIPC_CONN_MSG:
+ has_name = (tport->conn_type != 0);
anc_data[0] = tport->conn_type;
anc_data[1] = tport->conn_instance;
anc_data[2] = tport->conn_instance;
break;
default:
- anc_data[0] = 0;
+ has_name = 0;
}
- if (anc_data[0] &&
+ if (has_name &&
(res = put_cmsg(m, SOL_SOCKET, TIPC_DESTNAME, 12, anc_data)))
return res;