[Oisf-devel] [PATCH 0/2] lighten Packet structure v2
Victor Julien
victor at inliniac.net
Mon Nov 22 11:00:37 UTC 2010
go.ph1g at gmail.com wrote:
> Is it possible to check the MTU on the listening interface and set it
> that way? I don't know if all devices support it or whether it would be
> headache to manage cross platform. I can see where pcap-snoop has a
> method to get the MTU for IRIX interfaces.
>
> http://www.opensource.apple.com/source/libpcap/libpcap-18/libpcap/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;
> }
> /*
I like this idea. What do you think Eric?
Cheers,
Victor
--
---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
---------------------------------------------
More information about the Oisf-devel
mailing list