![Quote](https://cboard.cprogramming.com/images/misc/quote_icon.png)
Originally Posted by
ZuK
For that to happen you have to set your network interface to promiscuous mode. But that is almost everything I know about your problem.
Kurt
Yes, I am attempting to do that with the following calls:
Code:
struct ifreq ifr;
strncpy(ifr.ifr_name, interface, strlen(interface) + 1);
if((ioctl(sock, SIOCGIFFLAGS, &ifr) == -1)) {
/*Could not retrieve flags for the interface*/
perror("ioctl");
exit(EXIT_FAILURE);
}
printf("The interface is ::: %s\n", interface);
perror("Retrieved flags from interface successfully");
/*now that the flags have been retrieved*/
/* set the flags to PROMISC */
ifr.ifr_flags |= IFF_PROMISC;
if(ioctl (sock, SIOCSIFFLAGS, &ifr) == -1 ) {
/*Could not set the flags on the interface */
perror("ioctl");
exit(EXIT_FAILURE);
}
printf("Setting interface ::: %s ::: to promisc", interface);
return(0);