Is the below code enough to disable the loopback interface from receiving my own outgoing multicast traffic? My udp code appears to still receive packets even when I pull the RJ-45 Ethernet cable from the NIC.
char loopch = 0;
if(setsockopt(sd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&loopch, sizeof(loopch)) < 0){
perror("Setting IP_MULTICAST_LOOP error");
close(sd);
return -1;}