On Thu, Mar 15, 2001 at 11:03:04AM -0800, Guy Harris wrote:
> On Thu, Mar 15, 2001 at 09:05:33AM -0600, [EMAIL PROTECTED] wrote:
> > Tru64 UNIX 4.0D does not have snprintf. Neither does IRIX 6.2 nor
> > Solaris 2.5.1 (libpcap doesn't work under IRIX 6.2 anyway
> 
> What about it doesn't work?  What does it do instead of working?

In pcap-snoop.c:
#ifdef SIOCGIFMTU
        /*
         * XXX - IRIX appears to give you an error if you try to set the
         * capture length to be greater than the MTU, so let's try to get
         * the MTU first and, if that succeeds, trim the snap length
         * to be no greater than the MTU.
         */
        (void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
        if (ioctl(fd, SIOCGIFMTU, (char *)&ifr) < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "SIOCGIFMTU: %s",
                    pcap_strerror(errno));
                goto bad;
        }

Works fine with 6.5 but not 6.2 (tcpdump eventually cores on 6.5 but
at least some packets are captured). I've a note in to SGI about the
correct way to get MTU on 6.2 but haven't heard anything back yet.

According to 6.2, SIOCGIFMTU is an invalid operation on the socket.

> > but hey).
> > I ripped the snprintf.c from tcpdump 3.6.2 and made a few mods for it
> > to be a self-contained file.
> 
> You might want to note that the problem here is presumably not with
> tcpdump, which supplies its own "snprintf()", but with other
> applications using libpcap, which might not supply their own
> "snprintf()", or whose configure scripts might not be set up to, when
> checking for libpcap's existence, supply an "snprintf()" for the
> autoconf test program.

I'm aware of this. So, what is the solution? Should we not have
snprintf in libpcap?

-- 
albert chin ([EMAIL PROTECTED])
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to