MINOR: sock: provide a set of generic enable/disable functions

These will be used on receivers, to enable or disable receiving on a
listener, which most of the time just consists in enabling/disabling
the file descriptor.

We have to take care of the existence of fd_updt to know if we may
or not call fd_{want,stop}_recv() since it's not permitted in very
early boot.
diff --git a/include/haproxy/sock.h b/include/haproxy/sock.h
index 90dbc07..7000232 100644
--- a/include/haproxy/sock.h
+++ b/include/haproxy/sock.h
@@ -33,6 +33,8 @@
 extern struct xfer_sock_list *xfer_sock_list;
 
 int sock_create_server_socket(struct connection *conn);
+void sock_enable(struct receiver *rx);
+void sock_disable(struct receiver *rx);
 int sock_get_src(int fd, struct sockaddr *sa, socklen_t salen, int dir);
 int sock_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir);
 int sock_get_old_sockets(const char *unixsocket);
diff --git a/src/sock.c b/src/sock.c
index 3e414a8..c06a281 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -55,6 +55,24 @@
 	return my_socketat(ns, conn->dst->ss_family, SOCK_STREAM, 0);
 }
 
+/* Enables receiving on receiver <rx> once already bound. Does nothing in early
+ * boot (needs fd_updt).
+ */
+void sock_enable(struct receiver *rx)
+{
+        if (rx->flags & RX_F_BOUND && fd_updt)
+		fd_want_recv(rx->fd);
+}
+
+/* Disables receiving on receiver <rx> once already bound. Does nothing in early
+ * boot (needs fd_updt).
+ */
+void sock_disable(struct receiver *rx)
+{
+        if (rx->flags & RX_F_BOUND && fd_updt)
+		fd_stop_recv(rx->fd);
+}
+
 /*
  * Retrieves the source address for the socket <fd>, with <dir> indicating
  * if we're a listener (=0) or an initiator (!=0). It returns 0 in case of