#include #include #include #include #include #include #include #include int main (int argc, char **argv) { int sock; struct ifreq ifr; struct ethtool_value eval; int rc; if (argc < 2) { fprintf(stderr, "Usage: tx-chksum-off \n"); exit(1); } sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); if (sock < 0) { perror("socket"); exit(1); } strncpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name)); ifr.ifr_data = &eval; eval.cmd = ETHTOOL_STXCSUM; eval.data = 0; rc = ioctl(sock, SIOCETHTOOL, &ifr); if (rc < 0) { perror("ioctl"); exit(1); } return (0); }