Commit e53eea17 authored by Yann Garcia's avatar Yann Garcia
Browse files

Comment SO_BINDTODEVICE for testing

parent c444e517
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -148,12 +148,14 @@ int main(const int32_t p_argc, char* const p_argv[]) {
    ifr.ifr_addr.sa_family = AF_INET;
    ifr.ifr_addr.sa_family = AF_INET;
    snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", udp_nic);
    snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", udp_nic);
#ifndef __APPLE__
#ifndef __APPLE__
/* FIXME To test
    if (setsockopt(socket_hd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr.ifr_name, strlen(ifr.ifr_name)) < 0) {
    if (setsockopt(socket_hd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr.ifr_name, strlen(ifr.ifr_name)) < 0) {
      fprintf(stderr, "Failed to bind to interface:%s.\n", strerror(errno));
      fprintf(stderr, "Failed to bind to interface:%s.\n", strerror(errno));
      close(socket_hd);
      close(socket_hd);
      goto error;
      goto error;
    }
    }
    printf("Bound to device %s.\n", ifr.ifr_name);
    printf("Bound to device %s.\n", ifr.ifr_name);
*/
#endif
#endif
    /* Configure the udp_port and ip we want to receive from */
    /* Configure the udp_port and ip we want to receive from */
    if (udp_protocol != NULL) {
    if (udp_protocol != NULL) {