summaryrefslogtreecommitdiffstats
path: root/src/send.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 15:45:22 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 15:45:22 +0200
commitb63d267e79a54b1c1f0c3e987a28535055d5f574 (patch)
tree6301befdbbf64762983cf70cfa7f6e2532c5fba1 /src/send.c
parentd90524202c9484f2851dbe192847f71dadc22ce5 (diff)
downloadfastd-b63d267e79a54b1c1f0c3e987a28535055d5f574.tar
fastd-b63d267e79a54b1c1f0c3e987a28535055d5f574.zip
Don't forward frames with local destination MAC address
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/send.c b/src/send.c
index 19f0649..8b9aae7 100644
--- a/src/send.c
+++ b/src/send.c
@@ -206,16 +206,24 @@ static inline bool send_data_tap_single(fastd_buffer_t buffer, fastd_peer_t *sou
return true;
}
+ if (!source) {
+ fastd_eth_addr_t src_addr = fastd_buffer_source_address(buffer);
+
+ if (fastd_eth_addr_is_unicast(src_addr))
+ fastd_peer_eth_addr_add(NULL, src_addr);
+ }
+
fastd_eth_addr_t dest_addr = fastd_buffer_dest_address(buffer);
if (!fastd_eth_addr_is_unicast(dest_addr))
return false;
- fastd_peer_t *dest = fastd_peer_find_by_eth_addr(dest_addr);
+ fastd_peer_t *dest;
+ bool found = fastd_peer_find_by_eth_addr(dest_addr, &dest);
- if (!dest)
+ if (!found)
return false;
- if (dest == source) {
+ if (!dest || dest == source) {
fastd_buffer_free(buffer);
return true;
}