Skip to content

Commit b87e96e

Browse files
committed
network: address_equal() is not used anymore, hence move it to test-network.c
1 parent 3b6a3bd commit b87e96e

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/network/networkd-address.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,6 @@ int address_compare_func(const Address *a1, const Address *a2) {
316316

317317
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(address_hash_ops, Address, address_hash_func, address_compare_func, address_free);
318318

319-
bool address_equal(const Address *a1, const Address *a2) {
320-
if (a1 == a2)
321-
return true;
322-
323-
if (!a1 || !a2)
324-
return false;
325-
326-
return address_compare_func(a1, a2) == 0;
327-
}
328-
329319
int address_dup(const Address *src, Address **ret) {
330320
_cleanup_(address_freep) Address *dest = NULL;
331321
int r;

src/network/networkd-address.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Address* address_free(Address *address);
6363
int address_get(Link *link, const Address *in, Address **ret);
6464
int address_configure_handler_internal(sd_netlink *rtnl, sd_netlink_message *m, Link *link, const char *error_msg);
6565
int address_remove(Address *address);
66-
bool address_equal(const Address *a1, const Address *a2);
6766
int address_dup(const Address *src, Address **ret);
6867
bool address_is_ready(const Address *a);
6968
void address_set_broadcast(Address *a);

src/network/test-network.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ static int test_load_config(Manager *manager) {
170170
return 0;
171171
}
172172

173+
static bool address_equal(const Address *a1, const Address *a2) {
174+
if (a1 == a2)
175+
return true;
176+
177+
if (!a1 || !a2)
178+
return false;
179+
180+
return address_compare_func(a1, a2) == 0;
181+
}
182+
173183
static void test_address_equality(void) {
174184
_cleanup_(address_freep) Address *a1 = NULL, *a2 = NULL;
175185

0 commit comments

Comments
 (0)