patch-src_tun_c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- chillispot-1.1.0.orig/src/tun.c 2006-09-24 19:48:25.000000000 +0200
  3. +++ chillispot-1.1.0/src/tun.c 2009-05-21 20:51:19.000000000 +0200
  4. @@ -366,7 +366,7 @@ int tun_addaddr(struct tun_t *this,
  5. this->addrs++;
  6. return 0;
  7. -#elif defined (__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  8. +#elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  9. int fd;
  10. struct ifaliasreq areq;
  11. @@ -445,7 +445,7 @@ int tun_setaddr(struct tun_t *this,
  12. #if defined(__linux__)
  13. ifr.ifr_netmask.sa_family = AF_INET;
  14. -#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  15. +#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  16. ((struct sockaddr_in *) &ifr.ifr_addr)->sin_len =
  17. sizeof (struct sockaddr_in);
  18. ((struct sockaddr_in *) &ifr.ifr_dstaddr)->sin_len =
  19. @@ -497,7 +497,7 @@ int tun_setaddr(struct tun_t *this,
  20. ((struct sockaddr_in *) &ifr.ifr_netmask)->sin_addr.s_addr =
  21. netmask->s_addr;
  22. -#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  23. +#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  24. ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr =
  25. netmask->s_addr;
  26. @@ -585,7 +585,7 @@ int tun_route(struct tun_t *this,
  27. close(fd);
  28. return 0;
  29. -#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  30. +#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  31. struct {
  32. struct rt_msghdr rt;
  33. @@ -674,7 +674,7 @@ int tun_new(struct tun_t **tun)
  34. #if defined(__linux__)
  35. struct ifreq ifr;
  36. -#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  37. +#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  38. char devname[IFNAMSIZ+5]; /* "/dev/" + ifname */
  39. int devnum;
  40. struct ifaliasreq areq;
  41. @@ -722,7 +722,7 @@ int tun_new(struct tun_t **tun)
  42. ioctl((*tun)->fd, TUNSETNOCSUM, 1); /* Disable checksums */
  43. return 0;
  44. -#elif defined(__FreeBSD__) defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  45. +#elif defined(__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__APPLE__)
  46. /* Find suitable device */
  47. for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */