-make up ICMP payload for error responses on VPN->TUN link
authorChristian Grothoff <christian@grothoff.org>
Sat, 21 Jan 2012 20:12:03 +0000 (20:12 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 21 Jan 2012 20:12:03 +0000 (20:12 +0000)
src/vpn/gnunet-service-vpn.c

index 12b4eef4a776317b0376cce0b48ceb57fc9e54b1..94dadc70bc159c2b1e86206e3d1428e46d1587d8 100644 (file)
@@ -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);
 }