From 2c8eb2f20999f03d781045d7d5bdadf748fe3cfc Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Sun, 2 May 2010 23:22:21 +0000 Subject: [PATCH] Set the oft-forgotten sin_len. --- src/transport/plugin_transport_tcp.c | 6 ++++++ src/transport/plugin_transport_udp.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index e7512d980..fad999fa4 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -849,6 +849,9 @@ tcp_plugin_send (void *cls, t6 = addr; af = AF_INET6; memset (&a6, 0, sizeof (a6)); +#if HAVE_SOCKADDR_IN_SIN_LEN + a6.sin6_len = sizeof (a6); +#endif a6.sin6_family = AF_INET6; a6.sin6_port = t6->t6_port; memcpy (a6.sin6_addr.s6_addr, @@ -862,6 +865,9 @@ tcp_plugin_send (void *cls, t4 = addr; af = AF_INET; memset (&a4, 0, sizeof (a4)); +#if HAVE_SOCKADDR_IN_SIN_LEN + a4.sin_len = sizeof (a4); +#endif a4.sin_family = AF_INET; a4.sin_port = t4->t_port; a4.sin_addr.s_addr = t4->ipv4_addr; diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index a771bf973..0e7f4d126 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -297,6 +297,9 @@ udp_plugin_send (void *cls, t6 = addr; af = AF_INET6; memset (&a6, 0, sizeof (a6)); +#if HAVE_SOCKADDR_IN_SIN_LEN + a6.sin6_len = sizeof (a6); +#endif a6.sin6_family = AF_INET6; a6.sin6_port = t6->u6_port; memcpy (a6.sin6_addr.s6_addr, @@ -310,6 +313,9 @@ udp_plugin_send (void *cls, t4 = addr; af = AF_INET; memset (&a4, 0, sizeof (a4)); +#if HAVE_SOCKADDR_IN_SIN_LEN + a4.sin_len = sizeof (a4); +#endif a4.sin_family = AF_INET; a4.sin_port = t4->u_port; a4.sin_addr.s_addr = t4->ipv4_addr; -- 2.25.1