diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 19:38:18 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 19:38:18 +0200 |
commit | ee8b2de4b795fbc3b292e14c9f088244a7e08690 (patch) | |
tree | 561cfa9b830d315e4307d8c1aeceb1c475e192da /src/peer.c | |
parent | 0c82651c30bf543903ca05df4e5b179201353ee1 (diff) | |
download | fastd-ee8b2de4b795fbc3b292e14c9f088244a7e08690.tar fastd-ee8b2de4b795fbc3b292e14c9f088244a7e08690.zip |
ecfxp: refresh session key periodically
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -153,6 +153,8 @@ fastd_peer* fastd_peer_set_established_merge(fastd_context *ctx, fastd_peer *per ctx->conf->protocol->free_peer_state(ctx, perm_peer); + fastd_task_delete_peer_handshakes(ctx, perm_peer); + perm_peer->address = temp_peer->address; perm_peer->state = STATE_ESTABLISHED; perm_peer->seen = temp_peer->seen; @@ -174,24 +176,6 @@ fastd_peer* fastd_peer_set_established_merge(fastd_context *ctx, fastd_peer *per return perm_peer; } -const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer) { - switch (ctx->conf->mode) { - case MODE_TAP: - return (fastd_eth_addr*)&((struct ethhdr*)buffer.data)->h_source; - default: - exit_bug(ctx, "invalid mode"); - } -} - -const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer) { - switch (ctx->conf->mode) { - case MODE_TAP: - return (fastd_eth_addr*)&((struct ethhdr*)buffer.data)->h_dest; - default: - exit_bug(ctx, "invalid mode"); - } -} - void fastd_peer_set_established(fastd_context *ctx, fastd_peer *peer) { fastd_task_delete_peer_handshakes(ctx, peer); @@ -209,6 +193,23 @@ void fastd_peer_set_established(fastd_context *ctx, fastd_peer *peer) { } } +const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer) { + switch (ctx->conf->mode) { + case MODE_TAP: + return (fastd_eth_addr*)&((struct ethhdr*)buffer.data)->h_source; + default: + exit_bug(ctx, "invalid mode"); + } +} + +const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer) { + switch (ctx->conf->mode) { + case MODE_TAP: + return (fastd_eth_addr*)&((struct ethhdr*)buffer.data)->h_dest; + default: + exit_bug(ctx, "invalid mode"); + } +} static inline int fastd_eth_addr_cmp(const fastd_eth_addr *addr1, const fastd_eth_addr *addr2) { return memcmp(addr1->data, addr2->data, ETH_ALEN); |