Ethereal-dev: Re: [ethereal-dev] AIX: gtk problem solved, now an ethereal problem

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Craig Rodrigues <rodrigc@xxxxxxxxxxxx>
Date: Mon, 15 Nov 1999 11:30:08 -0500
On Mon, Nov 15, 1999 at 09:53:07AM -0500, Craig Rodrigues wrote:
> >         do {
> >                 (void)sprintf(device, "/dev/bpf%d", n++);
> >                 fd = open(device, O_RDONLY);
> >         } while (fd < 0 && errno == EBUSY);
> > 
> > loop with "fd" being a non-negative number?
> 
> Yes, fd is set to 10, and errno is set to 0x4a.
> 
> The actual lines where errstr is set is in pcap-bpf.c:
> 
>         (void) ioctl(fd, BIOCSBLEN, (caddr_t)&v);
> 
>         (void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
>         if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) < 0) {
>                 sprintf(ebuf, "%s: %s", device, pcap_strerror(errno));
>                 goto bad;
>         }
> 
> Ideas?

OK, I just tried something, and it seemed to work.
In pcap-bpf.c, I changed the following line:

        v = 32768;  /* XXX this should be a user-accessible hook */

to:
        v = 16384;

Now the ioctl() for BIOCSBLEN is called with a smaller value for v,
and things seem to work.....although all the messages I receive back
look like Token Ring packets now.

Can anyone tell me what BIOCSBLEN is, and what the correct value of v
should be?

Thanks.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@xxxxxxxxxxxx