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:21:28 -0700 |
commit | 34042f15e03680dddec4e81024b850c47621febe (patch) | |
tree | 9dd97322ea28a227f983e07e6ff4364e205d31c9 | |
parent | e83f11a50c4e8de94c5dd3946e7c727983dad42d (diff) |
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"); |