ctdb-protocol: Add generalised socket address comparison
commitedf48177b96cd04f212118a047041d0b3596673d
authorMartin Schwenke <martin@meltin.net>
Mon, 23 May 2016 00:35:10 +0000 (23 10:35 +1000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 20 Dec 2016 11:20:16 +0000 (20 12:20 +0100)
treeb60a19ffa161eb0ad8acab94ad4a767fbbc5f73a
parent3427e37115899ba1d765de64b0ad0b8e500f0f52
ctdb-protocol: Add generalised socket address comparison

Add new function ctdb_sock_addr_cmp(), which returns a 3-way result
useful for qsort(3).  Reimplent ctdb_sock_addr_same() using this.

In the process, make arguments const so that ctdb_sock_addr_cmp() can
be used with qsort().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 362f066d617c8a186164db613537867329702ab7)
ctdb/protocol/protocol_api.h
ctdb/protocol/protocol_util.c