|
|
@@ -2122,13 +2122,25 @@ void peer_recv_handler_send (struct peer_data *peer, uint8_t *data, int data_len
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+ // provided source ID must be the peer sending the frame
|
|
|
+ if (src_peer != peer) {
|
|
|
+ peer_log(peer, BLOG_NOTICE, "relay source must be the sending peer");
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
// lookup destination peer
|
|
|
struct peer_data *dest_peer = find_peer_by_id(id);
|
|
|
- if (!dest_peer || dest_peer == src_peer) {
|
|
|
+ if (!dest_peer) {
|
|
|
peer_log(peer, BLOG_NOTICE, "relay destination peer not known");
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+ // destination cannot be source
|
|
|
+ if (dest_peer == src_peer) {
|
|
|
+ peer_log(peer, BLOG_NOTICE, "relay destination cannot be the source");
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
relay_dest = dest_peer;
|
|
|
}
|
|
|
|