From a2de1176e7872185a8a6b0ce7cbc93bf30f0b395 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 13 Feb 2019 23:42:29 +0100 Subject: trying to improve things for #5560 --- src/transport/gnunet-service-transport_validation.c | 5 +++-- src/transport/plugin_transport_tcp.c | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/transport') diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 8d22d0c7a..6abe8d2d2 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -1115,7 +1115,8 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, } ping = (const struct TransportPingMessage *) hdr; if (0 != - memcmp (&ping->target, &GST_my_identity, + memcmp (&ping->target, + &GST_my_identity, sizeof (struct GNUNET_PeerIdentity))) { GNUNET_STATISTICS_update (GST_stats, diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index d93c4423c..a0dd80617 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -1471,6 +1471,12 @@ tcp_nat_port_map_callback (void *cls, args = sizeof (t4); break; case AF_INET6: + if (IN6_IS_ADDR_LINKLOCAL (&((struct sockaddr_in6 *) addr)->sin6_addr)) + { + /* skip link local, we don't allow them in + #tcp_plugin_check_address() */ + return; + } GNUNET_assert(addrlen == sizeof(struct sockaddr_in6)); memset (&t6, 0, sizeof(t6)); GNUNET_memcpy (&t6.ipv6_addr, -- cgit v1.2.3