diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 18:04:02 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-31 18:04:02 +0200 |
commit | 0c82651c30bf543903ca05df4e5b179201353ee1 (patch) | |
tree | 8c7d7eb1e2f41b500433b14213dc1532d4a79b0f /src/peer.c | |
parent | 342d63a45a8918e45ddcf6a0b82b2f593f4bde12 (diff) | |
download | fastd-0c82651c30bf543903ca05df4e5b179201353ee1.tar fastd-0c82651c30bf543903ca05df4e5b179201353ee1.zip |
Change how handshakes are triggered
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -192,6 +192,24 @@ const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buf } } +void fastd_peer_set_established(fastd_context *ctx, fastd_peer *peer) { + fastd_task_delete_peer_handshakes(ctx, peer); + + switch(peer->state) { + case STATE_WAIT: + pr_info(ctx, "Connection with %P established.", peer); + peer->state = STATE_ESTABLISHED; + break; + + case STATE_TEMP: + exit_bug(ctx, "tried to set a temporary connection to established"); + + default: + return; + } +} + + 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); } |