RE: Unable to talk to tap(4)

2008-05-16 Thread Wojciech Puchar
On Fri, 16 May 2008, Bob McConnell wrote: From: Wojciech Puchar if (buffer = NULL) { if (buffer == NULL) { anyway not using malloc is good habit :) but it should work anyway. try The test after the malloc was the problem. I have been working in a :)

RE: Unable to talk to tap(4)

2008-05-16 Thread Bob McConnell
From: Wojciech Puchar >> if (buffer = NULL) { >> >> if (buffer == NULL) { >> > anyway not using malloc is good habit :) but it should work anyway. > try The test after the malloc was the problem. I have been working in a poorly designed scripting language for several months where the

Re: Unable to talk to tap(4)

2008-05-16 Thread Lowell Gilbert
"Bob McConnell" <[EMAIL PROTECTED]> writes: > From: Bob McConnell >>From: Wojciech Puchar The basic setup sequence is: ifconfig tap0 create ifconfig tap0 inet 10.3.4.254/24 route -v add 10.3.4.0/24 10.3.4.254 >>> >>> ifconfig tap0 up >>> >>> ? >>> >> >> 'ifconfig'

Re: Unable to talk to tap(4)

2008-05-16 Thread Wojciech Puchar
unsigned char * buffer = (unsigned char*)malloc(1514); is stdlib.h included (i'm asking for sure)? if (buffer = NULL) { if (buffer == NULL) { fprintf (stderr, "No memory available.\n"); close (tapFD); exit(3); } When I replace the malloc with an automatic array, the er

Re: Unable to talk to tap(4)

2008-05-16 Thread Steve Randall
On Thu, 15 May 2008 14:49:26 -0400 "Bob McConnell" <[EMAIL PROTECTED]> wrote: > >>> My code so far: > >>> > >>> - tear along dotted line - > >>> tapFD = open ("/dev/tap0", O_RDWR); > >>> if (tapFD < 0) { > >>>fprintf (stderr, "Failed to open /dev/tap0: %d.\n",

RE: Unable to talk to tap(4)

2008-05-15 Thread Bob McConnell
From: Bob McConnell >From: Wojciech Puchar >>> >>> The basic setup sequence is: >>> >>> ifconfig tap0 create >>> ifconfig tap0 inet 10.3.4.254/24 >>> route -v add 10.3.4.0/24 10.3.4.254 >> >> ifconfig tap0 up >> >> ? >> > > 'ifconfig' already showed the interface flag UP. Adding this command >

RE: Unable to talk to tap(4)

2008-05-15 Thread Bob McConnell
From: Wojciech Puchar >> >> The basic setup sequence is: >> >> ifconfig tap0 create >> ifconfig tap0 inet 10.3.4.254/24 >> route -v add 10.3.4.0/24 10.3.4.254 > > ifconfig tap0 up > > ? > 'ifconfig' already showed the interface flag UP. Adding this command to the sequence has no effect on it. I

Re: Unable to talk to tap(4)

2008-05-14 Thread Wojciech Puchar
The basic setup sequence is: ifconfig tap0 create ifconfig tap0 inet 10.3.4.254/24 route -v add 10.3.4.0/24 10.3.4.254 ifconfig tap0 up ? At this point, I can ping that address and my application can open either /dev/net/tap0 or /dev/tap0. But when I try to read() from those devices, I