Pergunta

I know we can check through ethtool whether TCP segmentation has been offloaded. But I need to get this info from my own code. What is the simplest way to do this? Is there a flag that I can check for this?

Thanks Supreeth

Foi útil?

Solução

You can use the same ioctl() call as ethtool does. Just look at the source code for ethtool to figure out how it does it:

struct ethtool_value eval;

eval.cmd = ETHTOOL_GGSO;
ifr->ifr_data = (caddr_t)&eval;
err = ioctl(fd, SIOCETHTOOL, ifr);
if (err)
        perror("Cannot get device generic segmentation offload settings");
else {
        gso = eval.data;
        allfail = 0;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top