diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-03-20 05:18:53 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-03-20 05:18:53 +0100 |
commit | 2396dd4211c17d9f15567f148db95d6fa4083b5f (patch) | |
tree | 02b3e89ecb8539c62905fab9a02e4c85d2ad150e | |
parent | 6c659ee5fafea64fef403bf0343bbeda45225560 (diff) | |
download | fastd-2396dd4211c17d9f15567f148db95d6fa4083b5f.tar fastd-2396dd4211c17d9f15567f148db95d6fa4083b5f.zip |
Flood forwarded unicast frames the same way as locally generated ones
-rw-r--r-- | src/fastd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/fastd.c b/src/fastd.c index d082136..a6b8310 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -232,16 +232,17 @@ static inline void handle_forward(fastd_context_t *ctx, fastd_peer_t *source_pee if (fastd_eth_addr_is_unicast(dest_addr)) { fastd_peer_t *dest_peer = fastd_peer_find_by_eth_addr(ctx, dest_addr); - if (!dest_peer || dest_peer == source_peer || !fastd_peer_is_established(dest_peer)) { - fastd_buffer_free(buffer); + if (dest_peer) { + if (dest_peer != source_peer) + ctx->conf->protocol->send(ctx, dest_peer, buffer); + else + fastd_buffer_free(buffer); + return; } - - ctx->conf->protocol->send(ctx, dest_peer, buffer); - } - else { - fastd_send_all(ctx, source_peer, buffer); } + + fastd_send_all(ctx, source_peer, buffer); } void fastd_handle_receive(fastd_context_t *ctx, fastd_peer_t *peer, fastd_buffer_t buffer) { @@ -502,7 +503,7 @@ static inline bool handle_tun_tap(fastd_context_t *ctx, fastd_buffer_t buffer) { fastd_peer_t *peer = fastd_peer_find_by_eth_addr(ctx, dest_addr); - if (!peer || !fastd_peer_is_established(peer)) + if (!peer) return false; ctx->conf->protocol->send(ctx, peer, buffer); |