diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-17 19:30:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-17 19:30:12 +0000 |
commit | e0d8c3f1c05ab0cb218d7182c723298f7e981b58 (patch) | |
tree | b33c36503906c1ea96f11896db1d95603468e9a4 /src/dns | |
parent | 72c3f26dc08bd15e7142b002116950fe79baa5a1 (diff) | |
download | gnunet-e0d8c3f1c05ab0cb218d7182c723298f7e981b58.tar.gz gnunet-e0d8c3f1c05ab0cb218d7182c723298f7e981b58.zip |
-move IPv6 header initialization to tun library
Diffstat (limited to 'src/dns')
-rw-r--r-- | src/dns/gnunet-service-dns.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index 5dc6641e7..288304600 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -419,18 +419,11 @@ request_done (struct RequestRecord *rr) | |||
419 | 419 | ||
420 | spt = dst->sin6_port; | 420 | spt = dst->sin6_port; |
421 | dpt = src->sin6_port; | 421 | dpt = src->sin6_port; |
422 | ip.traffic_class_h = 0; | 422 | GNUNET_TUN_initialize_ipv6_header (&ip, |
423 | ip.version = 6; /* is there a named constant? I couldn't find one */ | 423 | IPPROTO_UDP, |
424 | ip.traffic_class_l = 0; | 424 | reply_len - sizeof (struct GNUNET_TUN_IPv6Header), |
425 | ip.flow_label = 0; | 425 | &dst->sin6_addr, |
426 | ip.payload_length = htons ((uint16_t) reply_len); | 426 | &src->sin6_addr); |
427 | ip.next_header = IPPROTO_UDP; | ||
428 | ip.hop_limit = 255; /* or lower? */ | ||
429 | ip.source_address = dst->sin6_addr; | ||
430 | ip.destination_address = src->sin6_addr; | ||
431 | udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, | ||
432 | &ip.source_address, | ||
433 | sizeof (struct in6_addr) * 2); | ||
434 | { | 427 | { |
435 | uint32_t tmp; | 428 | uint32_t tmp; |
436 | 429 | ||