diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2006-06-26 02:45:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-26 02:45:24 -0400 |
commit | 3546c7508d7e97fd855f8ac37afdd09622fa5ce1 (patch) | |
tree | bd7dcdbbb83244a4e06c06449d3fdbc965e1d118 /net/tipc | |
parent | 3388007bc4d662e50c2c01a7fb1fa2c31cea98ad (diff) |
[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/tipc')
-rw-r--r-- | net/tipc/socket.c | 8 |
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, | |||
731 | u32 anc_data[3]; | 731 | u32 anc_data[3]; |
732 | u32 err; | 732 | u32 err; |
733 | u32 dest_type; | 733 | u32 dest_type; |
734 | int has_name; | ||
734 | int res; | 735 | int res; |
735 | 736 | ||
736 | if (likely(m->msg_controllen == 0)) | 737 | if (likely(m->msg_controllen == 0)) |
@@ -755,24 +756,27 @@ static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg, | |||
755 | dest_type = msg ? msg_type(msg) : TIPC_DIRECT_MSG; | 756 | dest_type = msg ? msg_type(msg) : TIPC_DIRECT_MSG; |
756 | switch (dest_type) { | 757 | switch (dest_type) { |
757 | case TIPC_NAMED_MSG: | 758 | case TIPC_NAMED_MSG: |
759 | has_name = 1; | ||
758 | anc_data[0] = msg_nametype(msg); | 760 | anc_data[0] = msg_nametype(msg); |
759 | anc_data[1] = msg_namelower(msg); | 761 | anc_data[1] = msg_namelower(msg); |
760 | anc_data[2] = msg_namelower(msg); | 762 | anc_data[2] = msg_namelower(msg); |
761 | break; | 763 | break; |
762 | case TIPC_MCAST_MSG: | 764 | case TIPC_MCAST_MSG: |
765 | has_name = 1; | ||
763 | anc_data[0] = msg_nametype(msg); | 766 | anc_data[0] = msg_nametype(msg); |
764 | anc_data[1] = msg_namelower(msg); | 767 | anc_data[1] = msg_namelower(msg); |
765 | anc_data[2] = msg_nameupper(msg); | 768 | anc_data[2] = msg_nameupper(msg); |
766 | break; | 769 | break; |
767 | case TIPC_CONN_MSG: | 770 | case TIPC_CONN_MSG: |
771 | has_name = (tport->conn_type != 0); | ||
768 | anc_data[0] = tport->conn_type; | 772 | anc_data[0] = tport->conn_type; |
769 | anc_data[1] = tport->conn_instance; | 773 | anc_data[1] = tport->conn_instance; |
770 | anc_data[2] = tport->conn_instance; | 774 | anc_data[2] = tport->conn_instance; |
771 | break; | 775 | break; |
772 | default: | 776 | default: |
773 | anc_data[0] = 0; | 777 | has_name = 0; |
774 | } | 778 | } |
775 | if (anc_data[0] && | 779 | if (has_name && |
776 | (res = put_cmsg(m, SOL_SOCKET, TIPC_DESTNAME, 12, anc_data))) | 780 | (res = put_cmsg(m, SOL_SOCKET, TIPC_DESTNAME, 12, anc_data))) |
777 | return res; | 781 | return res; |
778 | 782 | ||