From cca293a6d474b2bd02a5fbfb1f2fae6179c395d6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 16 Nov 2015 18:47:01 +0100 Subject: Call ethernet address cleanup from generic maintenance task --- src/peer.c | 4 +--- src/peer.h | 1 + src/task.c | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/peer.c b/src/peer.c index 7f1ccb5..3b66bae 100644 --- a/src/peer.c +++ b/src/peer.c @@ -971,7 +971,7 @@ static bool maintain_peer(fastd_peer_t *peer) { } /** Removes all time-outed MAC addresses from \e ctx.eth_addrs */ -static void eth_addr_cleanup(void) { +void fastd_peer_eth_addr_cleanup(void) { size_t i, deleted = 0; for (i = 0; i < VECTOR_LEN(ctx.eth_addrs); i++) { @@ -997,8 +997,6 @@ void fastd_peer_maintenance(void) { if (maintain_peer(peer)) i++; } - - eth_addr_cleanup(); } /** Resets all peers */ diff --git a/src/peer.h b/src/peer.h index e83859e..a9f48ab 100644 --- a/src/peer.h +++ b/src/peer.h @@ -271,6 +271,7 @@ void fastd_peer_eth_addr_add(fastd_peer_t *peer, fastd_eth_addr_t addr); bool fastd_peer_find_by_eth_addr(const fastd_eth_addr_t addr, fastd_peer_t **peer); void fastd_peer_handle_handshake_task(fastd_task_t *task); +void fastd_peer_eth_addr_cleanup(void); void fastd_peer_maintenance(void); void fastd_peer_reset_all(void); diff --git a/src/task.c b/src/task.c index aa6225a..2fe79c8 100644 --- a/src/task.c +++ b/src/task.c @@ -37,6 +37,7 @@ static inline void maintenance(void) { fastd_socket_handle_binds(); fastd_peer_maintenance(); + fastd_peer_eth_addr_cleanup(); fastd_task_reschedule_relative(&ctx.next_maintenance, MAINTENANCE_INTERVAL); } -- cgit v1.2.3