Código
int main(void) { struct ifreq net_dev; int sockd; if ((sockd = socket(PF_INET, SOCK_DGRAM, 0)) < 0){ } net_dev.ifr_hwaddr.sa_data[0] = (unsigned char) 0x00; net_dev.ifr_hwaddr.sa_data[1] = (unsigned char) 0x11; net_dev.ifr_hwaddr.sa_data[2] = (unsigned char) 0x22; net_dev.ifr_hwaddr.sa_data[3] = (unsigned char) 0x33; net_dev.ifr_hwaddr.sa_data[4] = (unsigned char) 0x44; net_dev.ifr_hwaddr.sa_data[5] = (unsigned char) 0x55; if (ioctl(sockd, SIOCSIFHWADDR, &net_dev) < 0){ close(sockd); } int i; for (i = 0; i < 6; ++i) close(sockd); return 0; }
Probe de bajar la interface pero siempre obtengo el mismo error..
Gracias de antemano!