Don't process MDP packets if the local address is invalid

This commit is contained in:
Jeremy Lakeman 2014-05-12 13:42:41 +09:30
parent 9ed507f740
commit 8db634d2d9
2 changed files with 3 additions and 0 deletions

View File

@ -1347,6 +1347,7 @@ static void mdp_process_packet(struct socket_address *client, struct mdp_header
if (!internal_header.source || internal_header.source->reachable != REACHABLE_SELF){
mdp_reply_error(client, header);
WHY("Subscriber is not local");
return;
}
}
@ -1354,6 +1355,7 @@ static void mdp_process_packet(struct socket_address *client, struct mdp_header
// assign the next available port number
if (header->local.port==0 && header->flags & MDP_FLAG_BIND){
// TODO check if the port is already bound
if (next_port_binding > 32*1024)
next_port_binding=256;
else

View File

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <libgen.h>
#include "serval.h"
#include "str.h"
#include "conf.h"
#include "log.h"
#include "strbuf_helpers.h"