summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-lldp.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-25 19:38:48 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-02 12:18:54 +0100
commit8276855e48e77e4a7ffe40944df7df5c3db82a73 (patch)
tree712fe65eabecd9179b4e04b09ac3348c14fb9832 /src/libsystemd-network/sd-lldp.c
parentudev: use hashmap_clear_free_key() and hashmap_free_free_key() (diff)
downloadsystemd-8276855e48e77e4a7ffe40944df7df5c3db82a73.tar.xz
systemd-8276855e48e77e4a7ffe40944df7df5c3db82a73.zip
lldp: rename lldp_neighbor_id_hash_ops and set value destructor
Diffstat (limited to '')
-rw-r--r--src/libsystemd-network/sd-lldp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 4e3ee53cd7..e5cd134d57 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -27,12 +27,9 @@ static const char * const lldp_event_table[_SD_LLDP_EVENT_MAX] = {
DEFINE_STRING_TABLE_LOOKUP(lldp_event, sd_lldp_event);
static void lldp_flush_neighbors(sd_lldp *lldp) {
- sd_lldp_neighbor *n;
-
assert(lldp);
- while ((n = hashmap_first(lldp->neighbor_by_id)))
- lldp_neighbor_unlink(n);
+ hashmap_clear(lldp->neighbor_by_id);
}
static void lldp_callback(sd_lldp *lldp, sd_lldp_event event, sd_lldp_neighbor *n) {
@@ -375,7 +372,7 @@ _public_ int sd_lldp_new(sd_lldp **ret) {
.capability_mask = (uint16_t) -1,
};
- lldp->neighbor_by_id = hashmap_new(&lldp_neighbor_id_hash_ops);
+ lldp->neighbor_by_id = hashmap_new(&lldp_neighbor_hash_ops);
if (!lldp->neighbor_by_id)
return -ENOMEM;