summaryrefslogtreecommitdiff
path: root/socket
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@ktknet.cz>2016-04-04 21:46:05 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2016-04-04 21:48:59 +0100
commit38268e53fde8cd97055d88d2066c0016fe04b31b (patch)
treec648ea88d7ce2c8584eaa00267af620f283f4f7d /socket
parent7037ab4cf384edd9f700bc221a9d980b30d9c64f (diff)
downloadlibnice-38268e53fde8cd97055d88d2066c0016fe04b31b.tar.gz
socket: fix wrong function called in nice_socket_is_base_of()
We have to call is_base_of "virtual function pointer" of 'other' object, not 'sock', since 'other' is the structure whose base NiceSocket we need to get from its private data. For instance calling nice_socket_is_base_of() with 'sock' and 'other' being respectively pseudo-SSL and UDP-TURN-over-TCP invoked is_base_of variant for pseudo-SSL, casting other->priv into PseudoSSLPriv *, but other->priv is actually TurnTcpPriv *. It must be called the other way around. https://phabricator.freedesktop.org/T7335 https://phabricator.freedesktop.org/T7336 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com> Reviewed-by: Philip Withnall <philip@tecnocode.co.uk> Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com> Differential Revision: https://phabricator.freedesktop.org/D785
Diffstat (limited to 'socket')
-rw-r--r--socket/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/socket/socket.c b/socket/socket.c
index f726971..c514ecf 100644
--- a/socket/socket.c
+++ b/socket/socket.c
@@ -268,8 +268,8 @@ nice_socket_set_writable_callback (NiceSocket *sock,
gboolean
nice_socket_is_base_of (NiceSocket *sock, NiceSocket *other)
{
- if (sock->is_base_of)
- return sock->is_base_of (sock, other);
+ if (other->is_base_of)
+ return other->is_base_of (sock, other);
return (sock == other);
}