Skip to content

Commit

Permalink
modules/federation/send: Check for self-sends here.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Sep 5, 2018
1 parent bfa4d70 commit 11e14bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/federation/send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ handle_put(client &client,
pdu_failures.count()
};

// Don't accept sends to ourself for whatever reason (i.e a 127.0.0.1
// leaked into the target list). This should be a 500 so it's not
// considered success or cached as failure by the sender's state.
if(unlikely(my_host(request.origin)))
throw m::error
{
"M_SEND_TO_SELF", "Tried to send %s from myself to myself.",
txn_id
};

for(const auto &pdu_failure : pdu_failures)
handle_pdu_failure(client, request, txn_id, pdu_failure);

Expand Down

0 comments on commit 11e14bb

Please sign in to comment.