summaryrefslogtreecommitdiff
path: root/print/hplip/files/patch-protocol-discovery-mdns.c
diff options
context:
space:
mode:
Diffstat (limited to 'print/hplip/files/patch-protocol-discovery-mdns.c')
-rw-r--r--print/hplip/files/patch-protocol-discovery-mdns.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/print/hplip/files/patch-protocol-discovery-mdns.c b/print/hplip/files/patch-protocol-discovery-mdns.c
new file mode 100644
index 000000000000..402490b2764b
--- /dev/null
+++ b/print/hplip/files/patch-protocol-discovery-mdns.c
@@ -0,0 +1,27 @@
+--- protocol/discovery/mdns.c.orig 2016-02-08 09:43:19 UTC
++++ protocol/discovery/mdns.c
+@@ -24,7 +24,11 @@
+ Author: Sanjay Kumar
+ \*****************************************************************************/
+
+-//#include <stdio.h>
++#include <ctype.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/select.h>
+ #include <string.h>
+ #include <syslog.h>
+ #include <sys/socket.h>
+@@ -89,6 +93,11 @@ static int mdns_open_socket(int *psocket
+ BUG("unable to setsockopt: %m\n");
+ goto bugout;
+ }
++ if (setsockopt(udp_socket, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) == -1)
++ {
++ BUG("unable to setsockopt: %m\n");
++ goto bugout;
++ }
+
+ /* Bind the socket to port and IP equal to INADDR_ANY. */
+ bzero(&recv_addr, sizeof(recv_addr));