1
0
Fork 0
mirror of https://github.com/yarrick/iodine.git synced 2025-04-04 13:53:34 +03:00

Iodine: Cleaned up

This commit is contained in:
Julian Kranz 2012-01-28 16:39:44 +01:00 committed by Barak A. Pearlmutter
parent 7b2d0b2456
commit 1d7c33c7cb
3 changed files with 6 additions and 19 deletions

View file

@ -161,7 +161,7 @@ open_dns_ipv6(int localport, struct in6_addr listen_ip6)
struct sockaddr_in6 addr;
int flag = 1;
int fd;
int false = 0;
/* int false = 0; */
memset(&addr, 0, sizeof(addr));
addr.sin6_family = AF_INET6;

View file

@ -369,11 +369,6 @@ main(int argc, char **argv)
goto cleanup1;
}
// if ((dns_fd = open_dns(0, INADDR_ANY)) == -1) {
// retval = 1;
// goto cleanup2;
// }
#ifdef LINUX
if ((dns_fd = v6_connect ? open_dns_ipv6(0, in6addr_any) : open_dns(0, INADDR_ANY)) == -1) {
#else

View file

@ -191,13 +191,10 @@ send_raw(int fd, char *buf, int buflen, int user, int cmd, struct query *q)
inet_ntoa(tempin->sin_addr), cmd, len);
}
// printf("send_raw()");
// ipv6_print(&q->from.v6.sin6_addr, 66);
if(v6_listen)
sendto(fd, packet, len, 0, &q->from.v6, q->fromlen);
sendto(fd, packet, len, 0, (struct sockaddr *)&q->from.v6, q->fromlen);
else
sendto(fd, packet, len, 0, &q->from.v4, q->fromlen);
sendto(fd, packet, len, 0, (struct sockaddr *)&q->from.v4, q->fromlen);
}
static void
@ -2112,7 +2109,7 @@ read_dns(int fd, int tun_fd, struct query *q) /* FIXME: tun_fd is because of raw
r = recvmsg(fd, &msg, 0);
// printf("[DEBUG] read_dns() - Received message...\n");
/* printf("[DEBUG] read_dns() - Received message...\n"); */
#else
addrlen = sizeof(struct sockaddr);
@ -2149,8 +2146,7 @@ read_dns(int fd, int tun_fd, struct query *q) /* FIXME: tun_fd is because of raw
cmsg->cmsg_type == DSTADDR_SOCKOPT) {
q->destination.v4 = *dstaddr(cmsg);
break;// printf("write_dns()\n");
// ipv6_print(&q->from.v6, 44);
break;
}
#ifdef LINUX
if (cmsg->cmsg_level == IPPROTO_IPV6 &&
@ -2158,8 +2154,7 @@ read_dns(int fd, int tun_fd, struct query *q) /* FIXME: tun_fd is because of raw
memcpy(&q->destination.v6, cmsg->__cmsg_data, sizeof(struct in6_addr));
break;// printf("write_dns()\n");
// ipv6_print(&q->from.v6, 44);
break;
}
#endif
}
@ -2330,9 +2325,6 @@ write_dns(int fd, struct query *q, char *data, int datalen, char downenc)
inet_ntoa(tempin->sin_addr), q->type, q->name, datalen);
}
// printf("write_dns()\n");
// ipv6_print(&q->from.v6, 44);
sendto(fd, buf, len, 0, (struct sockaddr*)&q->from, q->fromlen);
}