From d80b5a0c8df702f3ca0fc04c8d0aafb4821c44ae Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Fri, 15 Feb 2013 16:13:08 +1030 Subject: [PATCH] Prevent sending probe packets to invalid addresses --- overlay_link.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/overlay_link.c b/overlay_link.c index efeaa8fd..8013bb43 100644 --- a/overlay_link.c +++ b/overlay_link.c @@ -254,6 +254,11 @@ int overlay_send_probe(struct subscriber *peer, struct sockaddr_in addr, overlay if (interface->state!=INTERFACE_STATE_UP) return WHY("I can't send a probe if the interface is down."); + if (addr.sin_addr.s_addr==0) + return WHY("I can't send a probe to address 0.0.0.0"); + if (addr.sin_port==0) + return WHY("I can't send a probe to port 0"); + // never send unicast probes over a stream interface if (interface->socket_type==SOCK_STREAM) return 0;