[Pkg-privacy-commits] [onioncat] 06/241: git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk at 120 58e1ccc2-750e-0410-8d0d-f93ca75ab447
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 26 16:16:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch upstream-master
in repository onioncat.
commit 8a995f9f4e82f125cbe7a6abdba1836266957b91
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Thu Feb 7 13:06:07 2008 +0000
git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk@120 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
ocatroute.c | 2 +-
ocattun.c | 22 +++++++++++++++++++---
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/ocatroute.c b/ocatroute.c
index 7359508..acf613a 100644
--- a/ocatroute.c
+++ b/ocatroute.c
@@ -452,7 +452,7 @@ void *socket_receiver(void *p)
{
*(((uint32_t*) ihd) - 1) = htonl(AF_INET6);
write(tunfd_[1], ((uint32_t*) ihd) - 1, plen + 4 + IP6HLEN);
- ihd = (struct ip6_hdr*) ((char*) ihd + plen + IP6HLEN)
+ ihd = (struct ip6_hdr*) ((char*) ihd + plen + IP6HLEN);
len -= plen + IP6HLEN;
plen = validate_frame(ihd, len);
}
diff --git a/ocattun.c b/ocattun.c
index 6bf05e3..cda05d4 100644
--- a/ocattun.c
+++ b/ocattun.c
@@ -69,7 +69,14 @@ int tun_alloc(char *dev, struct in6_addr addr)
if(ioctl(fd, TUNSETIFF, (void *) &ifr) < 0)
perror("TUNSETIFF"), exit(1);
strcpy(dev, ifr.ifr_name);
-#else
+#else /* FreeBSD */
+/* int prm = 0;
+ if (ioctl(fd, TUNSLMODE, &prm) == -1)
+ perror("ioctl:TUNSIFHEAD"), exit(1);
+
+ prm = IFF_POINTOPOINT;
+ if (ioctl(fd, TUNSIFMODE, &prm) == -1)
+ perror("ioctl:TUNSIFMODE"), exit(1);*/
#endif
#ifdef SET_TUN_IP
@@ -97,11 +104,20 @@ int tun_alloc(char *dev, struct in6_addr addr)
inet_ntop(AF_INET6, &addr, astr, INET6_ADDRSTRLEN);
#ifdef linux
sprintf(buf, "ifconfig tun0 add %s/%d up", astr, TOR_PREFIX_LEN);
+ if (system(buf) == -1)
+ log_msg(L_ERROR, "could not exec \"%s\": \"%s\"", buf, strerror(errno));
#else
sprintf(buf, "ifconfig tun0 inet6 %s/%d up", astr, TOR_PREFIX_LEN);
+/* if (system(buf) == -1)
+ log_msg(L_ERROR, "could not exec \"%s\": \"%s\"", buf, strerror(errno));*/
+ int prm = 1;
+ if (ioctl(fd, TUNSIFHEAD, &prm) == -1)
+ perror("ioctl:TUNSIFHEAD"), exit(1);
+ prm = IFF_POINTOPOINT;
+// prm = IFF_BROADCAST;
+ if (ioctl(fd, TUNSIFMODE, &prm) == -1)
+ perror("ioctl:TUNSIFMODE"), exit(1);
#endif
- if (system(buf) == -1)
- log_msg(L_ERROR, "could not exec \"%s\": \"%s\"", buf, strerror(errno));
#endif
return fd;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list