You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.5 KiB

  1. Description: remove yp host lookup and fix some types
  2. Author: Jan Delgado <jdelgado@gmx.net>
  3. Index: udptunnel-1.1/host2ip.c
  4. ===================================================================
  5. --- udptunnel-1.1.orig/host2ip.c
  6. +++ udptunnel-1.1/host2ip.c
  7. @@ -4,7 +4,6 @@
  8. #include <netdb.h> /* gethostbyname() */
  9. #include <netinet/in.h> /* sockaddr_in */
  10. #include <arpa/inet.h> /* inet_addr() */
  11. -#include <rpcsvc/ypclnt.h> /* YP */
  12. #include <ctype.h> /* isspace() */
  13. #include "host2ip.h"
  14. @@ -37,19 +36,9 @@ struct in_addr host2ip(char *host)
  15. else if ((hep = gethostbyname(host))) {
  16. in = *(struct in_addr *)(hep->h_addr_list[0]);
  17. }
  18. - /* As a last resort, try YP. */
  19. else {
  20. - static char *domain = 0; /* YP domain */
  21. - char *value; /* key value */
  22. - int value_len; /* length of returned value */
  23. -
  24. - if (!domain) yp_get_default_domain(&domain);
  25. - if (yp_match(domain, "hosts.byname", host, strlen(host), &value, &value_len) == 0) {
  26. - in.s_addr = inet_addr(value);
  27. - } else {
  28. /* Everything failed */
  29. in.s_addr = INADDR_ANY;
  30. - }
  31. }
  32. return in;
  33. } /* host2ip */
  34. Index: udptunnel-1.1/udptunnel.c
  35. ===================================================================
  36. --- udptunnel-1.1.orig/udptunnel.c
  37. +++ udptunnel-1.1/udptunnel.c
  38. @@ -423,7 +423,7 @@ static void await_incoming_connections(s
  39. for (i = 0; i < relay_count; i++) {
  40. if (FD_ISSET(relays[i].tcp_listen_sock, &readfds)) {
  41. struct sockaddr_in client_addr;
  42. - int addrlen = sizeof(client_addr);
  43. + socklen_t addrlen = sizeof(client_addr);
  44. if ((relays[i].tcp_sock =
  45. accept(relays[i].tcp_listen_sock,
  46. @@ -478,7 +478,7 @@ static int udp_to_tcp(struct relay *rela
  47. struct out_packet p;
  48. int buflen;
  49. struct sockaddr_in remote_udpaddr;
  50. - int addrlen = sizeof(remote_udpaddr);
  51. + socklen_t addrlen = sizeof(remote_udpaddr);
  52. if ((buflen = recvfrom(relay->udp_recv_sock, p.buf, UDPBUFFERSIZE, 0,
  53. (struct sockaddr *) &remote_udpaddr,
  54. @@ -555,7 +555,8 @@ static int tcp_to_udp(struct relay *rela
  55. /* There isn't a UDP listener waiting on the other end, but
  56. * that's okay, it's probably just not up at the moment or something.
  57. * Use getsockopt(SO_ERROR) to clear the error state. */
  58. - int err, len = sizeof(err);
  59. + int err;
  60. + socklen_t len = sizeof(err);
  61. if (debug > 1) {
  62. fprintf(stderr, "ECONNREFUSED on udp_send_sock; clearing.\n");