diff options
author | Gaurav <gaurav@gluster.com> | 2011-05-31 06:59:09 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-05-31 09:13:25 -0700 |
commit | 19be0c055a4d37a3db60f68484bb1b8bf976633c (patch) | |
tree | af7e6e40ecdc7941efa7e7498362fbb5da95fd43 | |
parent | bc92b11aa5d076ea2367d624b1b1030edebab5ea (diff) |
RPC : Valid typecasting for ipv4 and ipv6 in rpcsvc_get_listener_port.
Signed-off-by: Gaurav <gaurav@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2956 (Invalid typecating for ipv4 and ipv6 in rpcsvc_get_listener_port.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2956
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 159edba530b..457d76d4e5e 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1126,11 +1126,11 @@ rpcsvc_get_listener_port (rpcsvc_listener_t *listener) switch (listener->trans->myinfo.sockaddr.ss_family) { case AF_INET: - listener_port = ((struct sockaddr_in6 *)&listener->trans->myinfo.sockaddr)->sin6_port; + listener_port = ((struct sockaddr_in *)&listener->trans->myinfo.sockaddr)->sin_port; break; case AF_INET6: - listener_port = ((struct sockaddr_in *)&listener->trans->myinfo.sockaddr)->sin_port; + listener_port = ((struct sockaddr_in6 *)&listener->trans->myinfo.sockaddr)->sin6_port; break; default: |