diff options
Diffstat (limited to 'src/exit/gnunet-daemon-exit.c')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 7df72fb02..a4a0f967d 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -1065,21 +1065,11 @@ prepare_ipv4_packet (const void *payload, size_t payload_length, | |||
1065 | return; | 1065 | return; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | pkt4->version = 4; | 1068 | GNUNET_TUN_initialize_ipv4_header (pkt4, |
1069 | pkt4->header_length = sizeof (struct GNUNET_TUN_IPv4Header) / 4; | 1069 | protocol, |
1070 | pkt4->diff_serv = 0; | 1070 | len, |
1071 | pkt4->total_length = htons ((uint16_t) (sizeof (struct GNUNET_TUN_IPv4Header) + len)); | 1071 | &src_address->address.ipv4, |
1072 | pkt4->identification = (uint16_t) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 1072 | &dst_address->address.ipv4); |
1073 | UINT16_MAX + 1); | ||
1074 | pkt4->flags = 0; | ||
1075 | pkt4->fragmentation_offset = 0; | ||
1076 | pkt4->ttl = 255; | ||
1077 | pkt4->protocol = protocol; | ||
1078 | pkt4->checksum = 0; | ||
1079 | pkt4->destination_address = dst_address->address.ipv4; | ||
1080 | pkt4->source_address = src_address->address.ipv4; | ||
1081 | pkt4->checksum = GNUNET_CRYPTO_crc16_n (pkt4, sizeof (struct GNUNET_TUN_IPv4Header)); | ||
1082 | |||
1083 | switch (protocol) | 1073 | switch (protocol) |
1084 | { | 1074 | { |
1085 | case IPPROTO_UDP: | 1075 | case IPPROTO_UDP: |