summaryrefslogtreecommitdiff
path: root/ripd
diff options
context:
space:
mode:
authorNick Hilliard <nick@inex.ie>2012-08-18 15:10:57 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2012-09-25 06:03:46 +0200
commitbb2315f2878da685fae094aece13409667d21f97 (patch)
treeb8625a91196bc54e4f4f253711c611bd9212e638 /ripd
parent1b54f798d3cc359bec036db83c1c9bfab75d1244 (diff)
ripd: clear sockaddr_in before using
ripd_create_socket() failed in bind() on Mac OS X 10.7 since there was garbage in unused fields of struct sockaddr_in. * ripd/ripd.c: zero out struct sockaddr_sin from before filling. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ripd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 5a6dbc8c..db29d54a 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -1475,6 +1475,7 @@ rip_send_packet (u_char * buf, int size, struct sockaddr_in *to,
sin.sin_addr.s_addr = htonl (INADDR_RIP_GROUP);
/* multicast send should bind to local interface address */
+ memset (&from, 0, sizeof (from));
from.sin_family = AF_INET;
from.sin_port = htons (RIP_PORT_DEFAULT);
from.sin_addr = ifc->address->u.prefix4;