[Pkg-privacy-commits] [onioncat] 67/340: ndp works a little
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:04:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository onioncat.
commit 30f5fcb0901c6a9d6ed71d458169a793c593cf75
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Fri Oct 17 14:57:39 2008 +0000
ndp works a little
git-svn-id: http://www.cypherpunk.at/svn/onioncat/trunk@327 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
src/ocat.c | 5 +++++
src/ocat.h | 1 +
src/ocatsetup.c | 3 ++-
src/ocattun.c | 5 ++++-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/ocat.c b/src/ocat.c
index 3a9001d..e658090 100644
--- a/src/ocat.c
+++ b/src/ocat.c
@@ -51,6 +51,7 @@ void usage(const char *s)
" -i convert onion hostname to IPv6 and exit\n"
" -l <port> set ocat listen port, default = %d\n"
" -o <ipv6_addr> convert IPv6 address to onion url and exit\n"
+ " -p use TAP device instead of TUN\n"
" -r run as root, i.e. do not change uid/gid\n"
" -s <port> set hidden service virtual port, default = %d\n"
" -t <port> set tor SOCKS port, default = %d\n"
@@ -112,6 +113,10 @@ int main(int argc, char *argv[])
urlconv = 2;
break;
+ case 'p':
+ setup.use_tap = 1;
+ break;
+
case 'r':
runasroot = 1;
setup.usrname = "root";
diff --git a/src/ocat.h b/src/ocat.h
index 9311d48..54f5601 100644
--- a/src/ocat.h
+++ b/src/ocat.h
@@ -156,6 +156,7 @@ struct OcatSetup
int ocat_addr4_mask;
char *config_file;
int config_read;
+ int use_tap;
};
typedef struct PacketQueue
diff --git a/src/ocatsetup.c b/src/ocatsetup.c
index e79e797..ef3b56b 100644
--- a/src/ocatsetup.c
+++ b/src/ocatsetup.c
@@ -31,6 +31,7 @@ struct OcatSetup setup = {{0, 0}, TOR_SOCKS_PORT, OCAT_LISTEN_PORT, OCAT_DEST_PO
{0, 1},
4, OCAT_UNAME, {0}, {{{0}}}, 0, 0, 1, OCAT_DIR, TUN_DEV,
0, TOR_PREFIX4, TOR_PREFIX4_MASK,
- NULL, 1
+ NULL, 1,
+ 0 // use_tap
};
diff --git a/src/ocattun.c b/src/ocattun.c
index 39df6f4..d9a5e35 100644
--- a/src/ocattun.c
+++ b/src/ocattun.c
@@ -72,7 +72,10 @@ int tun_alloc(char *dev, struct in6_addr addr)
#ifdef __linux__
memset(&ifr, 0, sizeof(ifr));
- ifr.ifr_flags = IFF_TUN;
+ if (setup.use_tap)
+ ifr.ifr_flags = IFF_TAP;
+ else
+ ifr.ifr_flags = IFF_TUN;
//ifr.ifr_flags |= IFF_NO_PI;
if (*dev)
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
--
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