Ticket #61907: patch-rtl_tcp-bind.diff

File patch-rtl_tcp-bind.diff, 522 bytes (added by mndodd, 4 years ago)
  • src/rtl_tcp.c

    a b  
    555555                setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, (char *)&r, sizeof(int));
    556556                setsockopt(listensocket, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling));
    557557
    558                 if (bind(listensocket, (struct sockaddr *)&local, sizeof(local)))
     558                if (bind(listensocket, (struct sockaddr *)ai->ai_addr, ai->ai_addrlen))
    559559                        fprintf(stderr, "rtl_tcp bind error: %s", strerror(errno));
    560560                else
    561561                        break;