From c5dc23a6f2cfd4cff8cb13fa50614816dd480843 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 21 Jan 2012 20:12:03 +0000 Subject: [PATCH] -make up ICMP payload for error responses on VPN->TUN link --- src/vpn/gnunet-service-vpn.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 12b4eef4a..94dadc70b 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c @@ -1613,8 +1613,15 @@ make_up_icmpv4_payload (struct TunnelState *ts, struct GNUNET_TUN_IPv4Header *ipp, struct GNUNET_TUN_UdpHeader *udp) { - /* FIXME */ - GNUNET_break (0); + GNUNET_TUN_initialize_ipv4_header (ipp, + ts->protocol, + sizeof (struct GNUNET_TUN_TcpHeader), + &ts->source_ip.v4, + &ts->destination_ip.v4); + udp->spt = htons (ts->source_port); + udp->dpt = htons (ts->destination_port); + udp->len = htons (0); + udp->crc = htons (0); } @@ -1632,8 +1639,15 @@ make_up_icmpv6_payload (struct TunnelState *ts, struct GNUNET_TUN_IPv6Header *ipp, struct GNUNET_TUN_UdpHeader *udp) { - /* FIXME */ - GNUNET_break (0); + GNUNET_TUN_initialize_ipv6_header (ipp, + ts->protocol, + sizeof (struct GNUNET_TUN_TcpHeader), + &ts->source_ip.v6, + &ts->destination_ip.v6); + udp->spt = htons (ts->source_port); + udp->dpt = htons (ts->destination_port); + udp->len = htons (0); + udp->crc = htons (0); } -- 2.25.1