[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12692 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12692 - gnunet/src/transport |
Date: |
Fri, 20 Aug 2010 16:03:17 +0200 |
Author: grothoff
Date: 2010-08-20 16:03:17 +0200 (Fri, 20 Aug 2010)
New Revision: 12692
Modified:
gnunet/src/transport/gnunet-nat-client-windows.c
gnunet/src/transport/gnunet-nat-client.c
gnunet/src/transport/gnunet-nat-server-windows.c
gnunet/src/transport/gnunet-nat-server.c
Log:
more code cleanup
Modified: gnunet/src/transport/gnunet-nat-client-windows.c
===================================================================
--- gnunet/src/transport/gnunet-nat-client-windows.c 2010-08-20 14:00:27 UTC
(rev 12691)
+++ gnunet/src/transport/gnunet-nat-client-windows.c 2010-08-20 14:03:17 UTC
(rev 12692)
@@ -249,7 +249,6 @@
/* ip header: send to (known) ip address */
off = 0;
- memset(&ip_pkt, 0, sizeof(ip_pkt));
ip_pkt.vers_ihl = 0x45;
ip_pkt.tos = 0;
ip_pkt.pkt_len = htons(sizeof (packet));
Modified: gnunet/src/transport/gnunet-nat-client.c
===================================================================
--- gnunet/src/transport/gnunet-nat-client.c 2010-08-20 14:00:27 UTC (rev
12691)
+++ gnunet/src/transport/gnunet-nat-client.c 2010-08-20 14:03:17 UTC (rev
12692)
@@ -40,10 +40,11 @@
* - Christian Grothoff
* - Nathan Evans
*/
-#define _GNU_SOURCE
#if HAVE_CONFIG_H
/* Just needed for HAVE_SOCKADDR_IN_SIN_LEN test macro! */
#include "gnunet_config.h"
+#else
+#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/socket.h>
@@ -375,7 +376,7 @@
/* no go back to calculate ICMP packet checksum */
off = sizeof (ip_pkt);
- icmp_pkt.checksum = htons(calc_checksum(&packet[off],
+ icmp_pkt.checksum = htons(calc_checksum((uint16_t*) &packet[off],
sizeof (struct icmp_packet) +
sizeof(struct ip_packet) + sizeof(struct icmp_echo_packet)));
memcpy (&packet[off],
&icmp_pkt,
Modified: gnunet/src/transport/gnunet-nat-server-windows.c
===================================================================
--- gnunet/src/transport/gnunet-nat-server-windows.c 2010-08-20 14:00:27 UTC
(rev 12691)
+++ gnunet/src/transport/gnunet-nat-server-windows.c 2010-08-20 14:03:17 UTC
(rev 12692)
@@ -255,7 +255,7 @@
ip_pkt.src_ip = my_ip->s_addr;
ip_pkt.dst_ip = dummy.s_addr;
ip_pkt.checksum = htons(calc_checksum((uint16_t*)&ip_pkt, sizeof (ip_pkt)));
- memcpy (packet, &ip_pkt, sizeof (ip_pkt));
+ memcpy (&packet[off], &ip_pkt, sizeof (ip_pkt));
off += sizeof (ip_pkt);
icmp_echo.type = ICMP_ECHO;
Modified: gnunet/src/transport/gnunet-nat-server.c
===================================================================
--- gnunet/src/transport/gnunet-nat-server.c 2010-08-20 14:00:27 UTC (rev
12691)
+++ gnunet/src/transport/gnunet-nat-server.c 2010-08-20 14:03:17 UTC (rev
12692)
@@ -40,10 +40,11 @@
* - Christian Grothoff
* - Nathan Evans
*/
-#define _GNU_SOURCE
#if HAVE_CONFIG_H
/* Just needed for HAVE_SOCKADDR_IN_SIN_LEN test macro! */
#include "gnunet_config.h"
+#else
+#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/socket.h>
@@ -237,9 +238,6 @@
icmp_echo.checksum = 0;
icmp_echo.checksum = htons(calc_checksum((uint16_t*)&icmp_echo,
sizeof (struct icmp_packet)));
-
- make_echo (my_ip, &icmp_echo);
-
memcpy (&packet[off], &icmp_echo, sizeof (icmp_echo));
off += sizeof (icmp_echo);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12692 - gnunet/src/transport,
gnunet <=