I'm currently using MTU per interface, as i'm using a virtual interface to implement some VPN algorithm. Here's how it's done :
struct ifreq ifr;
ifr.ifr_addr.sa_family = AF_INET;
strncpy(ifr.ifr_name, "en0", sizeof(ifr.ifr_name));
ifr.ifr_mtu = 1000;
if (ioctl(sockfd, SIOCSIFMTU, (caddr_t)&ifr) < 0)
I was wondering if setting the mtu can be done on the connection/socket level (using getsockopt
command for example) ?
Also, is there an option to change the MTU after socket creation ?
Thanks !