Download | Plain Text | No Line Numbers


  1. diff -Naur dns.h dns.h
  2. --- dns.h 2000-03-18 16:18:42.000000000 +0100
  3. +++ dns.h 2011-06-02 19:18:55.000000000 +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. char *servers;
  16. + uint16 port;
  17. char localip[4];
  18. char qtype[2];
  19. } ;
  20. diff -Naur dns_transmit.c dns_transmit.c
  21. --- dns_transmit.c 2000-03-18 16:18:42.000000000 +0100
  22. +++ dns_transmit.c 2011-06-02 19:19:47.000000000 +0200
  23. @@ -5,6 +5,7 @@
  24. #include "readwrite.h"
  25. #include "uint16.h"
  26. #include "dns.h"
  27. +#include "env.h"
  28.  
  29. static int serverwantstcp(char *buf,unsigned int len)
  30. {
  31. @@ -109,7 +110,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_connect4(d->s1 - 1,ip,53) == 0)
  36. + if (socket_connect4(d->s1 - 1,ip,d->port) == 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. @@ -163,7 +164,7 @@
  41. taia_now(&now);
  42. taia_uint(&d->deadline,10);
  43. taia_add(&d->deadline,&d->deadline,&now);
  44. - if (socket_connect4(d->s1 - 1,ip,53) == 0) {
  45. + if (socket_connect4(d->s1 - 1,ip,d->port) == 0) {
  46. d->tcpstate = 2;
  47. return 0;
  48. }
  49. @@ -211,6 +212,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,4,localip);
  56.  
  57. d->udploop = flagrecursive ? 1 : 0;
  58.