Download | Plain Text | No Line Numbers


  1. diff -Naur ucspi-tcp6-1.00.orig/src/dns.h ucspi-tcp6-1.00/src/dns.h
  2. --- ucspi-tcp6-1.00.orig/src/dns.h 2013-05-04 16:50:39.000000000 +0200
  3. +++ ucspi-tcp6-1.00/src/dns.h 2014-05-18 23:31:30.195434565 +0200
  4. @@ -4,6 +4,7 @@
  5. #include "stralloc.h"
  6. #include "iopause.h"
  7. #include "taia.h"
  8. +#include "uint16.h"
  9.  
  10. #define DNS_C_IN "\0\1"
  11. #define DNS_C_ANY "\0\377"
  12. @@ -35,6 +36,7 @@
  13. struct taia deadline;
  14. unsigned int pos;
  15. const char *servers;
  16. + uint16 port;
  17. char localip[16];
  18. unsigned int scope_id;
  19. char qtype[2];
  20. diff -Naur ucspi-tcp6-1.00.orig/src/dns_transmit.c ucspi-tcp6-1.00/src/dns_transmit.c
  21. --- ucspi-tcp6-1.00.orig/src/dns_transmit.c 2014-01-08 14:57:35.000000000 +0100
  22. +++ ucspi-tcp6-1.00/src/dns_transmit.c 2014-05-18 23:31:30.196434582 +0200
  23. @@ -8,6 +8,7 @@
  24. #include "uint16.h"
  25. #include "dns.h"
  26. #include "ip6.h"
  27. +#include "env.h"
  28.  
  29. #define UDPSIZE 1024 /* IPv6 MTU size is 1280 byte */
  30.  
  31. @@ -114,7 +115,7 @@
  32. if (!d->s1) { dns_transmit_free(d); return -1; }
  33. if (randombind(d) == -1) { dns_transmit_free(d); return -1; }
  34.  
  35. - if (socket_connect6(d->s1 - 1,ip,53,d->scope_id) == 0)
  36. + if (socket_connect6(d->s1 - 1,ip,d->port,d->scope_id) == 0)
  37. if (send(d->s1 - 1,d->query + 2,d->querylen - 2,0) == d->querylen - 2) {
  38. struct taia now;
  39. taia_now(&now);
  40. @@ -168,7 +169,7 @@
  41. taia_now(&now);
  42. taia_uint(&d->deadline,10);
  43. taia_add(&d->deadline,&d->deadline,&now);
  44. - if (socket_connect6(d->s1 - 1,ip,53,d->scope_id) == 0) {
  45. + if (socket_connect6(d->s1 - 1,ip,d->port,d->scope_id) == 0) {
  46. d->tcpstate = 2;
  47. return 0;
  48. }
  49. @@ -216,6 +217,8 @@
  50.  
  51. byte_copy(d->qtype,2,qtype);
  52. d->servers = servers;
  53. + d->port = 53;
  54. + if (env_get("DNSCACHEPORT")) scan_ulong(env_get("DNSCACHEPORT"),&d->port);
  55. byte_copy(d->localip,16,localip);
  56.  
  57. d->udploop = flagrecursive ? 1 : 0;
  58.