diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-08-14 15:21:28 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-08-14 15:22:02 -0700 |
commit | b65e63c7738fc785120cc91d93896aa4c4a43474 (patch) | |
tree | 26ea0b3e23461a610274c7058bfc99a3fdabe157 | |
parent | 573de3de9fbc23bf8a0dd90ba3c264464d0df67f (diff) | |
download | libpcap-b65e63c7738fc785120cc91d93896aa4c4a43474.tar.gz |
Don't assume any of the ETHTOOL_ offloading values are defined.
Some older Linuxes appear to have the ethtool ioctls but not define
ETHTOOL_GTSO, ETHTOOL_GUFO, or ETHTOOL_GGSO.
-rw-r--r-- | pcap-linux.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index ea7618dd..cedc2caf 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -4789,18 +4789,23 @@ iface_get_offload(pcap_t *handle) { int ret; +#ifdef ETHTOOL_GTSO ret = iface_ethtool_ioctl(handle, ETHTOOL_GTSO, "ETHTOOL_GTSO"); if (ret == -1) return -1; if (ret) return 1; /* TCP segmentation offloading on */ +#endif +#ifdef ETHTOOL_GUFO ret = iface_ethtool_ioctl(handle, ETHTOOL_GUFO, "ETHTOOL_GUFO"); if (ret == -1) return -1; if (ret) return 1; /* UDP fragmentation offloading on */ +#endif +#ifdef ETHTOOL_GGSO /* * XXX - will this cause large unsegmented packets to be * handed to PF_PACKET sockets on transmission? If not, @@ -4811,6 +4816,7 @@ iface_get_offload(pcap_t *handle) return -1; if (ret) return 1; /* generic segmentation offloading on */ +#endif #ifdef ETHTOOL_GFLAGS ret = iface_ethtool_ioctl(handle, ETHTOOL_GFLAGS, "ETHTOOL_GFLAGS"); |