Re: writev fails on tun
Subject : Re: writev fails on tun
From: anil kumar dahiya <email@hidden >
Date: Tue, 4 Apr 2006 03:33:12 -0700 (PDT)
Delivered-to: email@hidden
Delivered-to: email@hidden
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=nrpY6k0PGskP4Ildk/1fK4MBbYSS6mIERcKIvl09VjQtk7sebl6mqnIZ02BWqN1pnTf0vImIA6vkHnAAwqN4ttkqgiClZWiHj4XXfS14HlJ7xKJHqlXLqN85MBsZT5oNqX+AEnh1ZXttP4yL76ATZA2m4/n5HnOqt0vtdHPDZo0= ;
sorry in last mail .. i made some mistake ...so i am writting mail again :
HI
ifconfig on my system shows that :
tun0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.13.76 --> 192.168.11.76 netmask 0xffffff00 open (pid 583)
I am writting data to tun device as :
int write_tun ( unsigned char *buf, int len) { int ret = 0 ;
u_int32_t type; struct iovec iv[2]; struct ip *iph;
iph = (struct ip *) buf; printf(" write
tun IN");
type = htonl (AF_INET);
iv[0].iov_base = &type; iv[0].iov_len = sizeof (type); iv[1].iov_base = buf; iv[1].iov_len = len; ret=openbsd_modify_read_write_return (writev (fd, iv, 2)); printf(" write tun Out=%d\n",ret); }
But when i do dmesg:
it shows that :
tun: could not determine the ip version
Can anyone suggest where thinges are going wrong.
--- Anil
anil kumar dahiya <email@hidden> wrote:
HI
ifconfig on my system shows that :
tun0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.13.76 --> 192.168.11.76 netmask 0xffffff00 open (pid 583)
I am writting data to tun device as :
u_int32_t type; struct iovec iv[2]; struct ip *iph;
iph = (struct ip *) buf; printf(" write tun IN");
type = htonl (AF_INET);
iv[0].iov_base = &type; iv[0].iov_len = sizeof (type); iv[0].iov_base = buf; iv[0].iov_len = len; openbsd_modify_read_write_return (writev (fd, iv, 2));
But when i do dmesg:
it shows that :
tun: could not determine the ip version
Can anyone suggest where thinges are going wrong.
--- Anil
New Yahoo! Messenger with Voice.
Call regular phones from your PC and
save big. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden
This email sent to email@hidden
New Yahoo! Messenger with Voice.
Call regular phones from your PC and save big.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.