reuseaddr.patch 578 B

12345678910111213141516
  1. Index: netcat-openbsd-1.89/netcat.c
  2. ===================================================================
  3. --- netcat-openbsd-1.89.orig/netcat.c 2008-01-22 16:17:25.000000000 -0500
  4. +++ netcat-openbsd-1.89/netcat.c 2008-01-22 16:17:27.000000000 -0500
  5. @@ -554,6 +554,10 @@
  6. if ((s = socket(res0->ai_family, res0->ai_socktype,
  7. res0->ai_protocol)) < 0)
  8. continue;
  9. +
  10. + ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x));
  11. + if (ret == -1)
  12. + err(1, NULL);
  13. #ifdef SO_REUSEPORT
  14. ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
  15. if (ret == -1)