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.

63 lines
2.2 KiB

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