MEDIUM: protocol: do not call proto->bind() anymore from bind_listener()

All protocol's listeners now only take care of themselves and not of
the receiver anymore since that's already being done in proto_bind_all().
Now it finally becomes obvious that UDP doesn't need a listener, as the
only thing it does is to set the listener's state to LI_LISTEN!
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 00fce76..a920f4e 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -162,12 +162,11 @@
 	if (listener->state != LI_ASSIGNED)
 		return ERR_NONE; /* already bound */
 
-	err = sockpair_bind_receiver(&listener->rx, listener->rx.proto->accept, &msg);
-	if (err != ERR_NONE) {
-		snprintf(errmsg, errlen, "%s", msg);
-		free(msg); msg = NULL;
-		return err;
+	if (!(listener->rx.flags & RX_F_BOUND)) {
+		msg = "receiving socket not bound";
+		goto err_return;
 	}
+
 	listener->state = LI_LISTEN;
 	return err;
 
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 57ccfed..4af22e5 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -561,6 +561,8 @@
 	socklen_t ready_len;
 	char *msg = NULL;
 
+	err = ERR_NONE;
+
 	/* ensure we never return garbage */
 	if (errlen)
 		*errmsg = 0;
@@ -568,11 +570,9 @@
 	if (listener->state != LI_ASSIGNED)
 		return ERR_NONE; /* already bound */
 
-	err = sock_inet_bind_receiver(&listener->rx, listener->rx.proto->accept, &msg);
-	if (err != ERR_NONE) {
-		snprintf(errmsg, errlen, "%s", msg);
-		free(msg); msg = NULL;
-		return err;
+	if (!(listener->rx.flags & RX_F_BOUND)) {
+		msg = "receiving socket not bound";
+		goto tcp_return;
 	}
 
 	fd = listener->rx.fd;
@@ -691,6 +691,7 @@
 
  tcp_close_return:
 	close(fd);
+ tcp_return:
 	if (msg && errlen) {
 		char pn[INET6_ADDRSTRLEN];
 
diff --git a/src/proto_udp.c b/src/proto_udp.c
index 957deb4..43eff39 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -180,7 +180,6 @@
 int udp_bind_listener(struct listener *listener, char *errmsg, int errlen)
 {
 	int err = ERR_NONE;
-	void *handler = NULL;
 	char *msg = NULL;
 
 	/* ensure we never return garbage */
@@ -190,23 +189,11 @@
 	if (listener->state != LI_ASSIGNED)
 		return ERR_NONE; /* already bound */
 
-	switch (listener->bind_conf->frontend->mode) {
-	case PR_MODE_SYSLOG:
-		handler = syslog_fd_handler;
-		break;
-	default:
-		err |= ERR_FATAL | ERR_ALERT;
-		msg = "UDP is not yet supported on this proxy mode";
+	if (!(listener->rx.flags & RX_F_BOUND)) {
+		msg = "receiving socket not bound";
 		goto udp_return;
 	}
 
-	err = sock_inet_bind_receiver(&listener->rx, handler, &msg);
-
-	if (err != ERR_NONE) {
-		snprintf(errmsg, errlen, "%s", msg);
-		free(msg); msg = NULL;
-		return err;
-	}
 	listener->state = LI_LISTEN;
 
  udp_return:
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 3e29e87..5ceb18f 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -103,11 +103,9 @@
 	if (listener->state != LI_ASSIGNED)
 		return ERR_NONE; /* already bound */
 
-	err = sock_unix_bind_receiver(&listener->rx, listener->rx.proto->accept, &msg);
-	if (err != ERR_NONE) {
-		snprintf(errmsg, errlen, "%s", msg);
-		free(msg); msg = NULL;
-		return err;
+	if (!(listener->rx.flags & RX_F_BOUND)) {
+		msg = "receiving socket not bound";
+		goto uxst_return;
 	}
 
 	fd = listener->rx.fd;
@@ -130,6 +128,7 @@
 
  uxst_close_return:
 	close(fd);
+ uxst_return:
 	if (msg && errlen) {
 		const char *path = ((struct sockaddr_un *)&listener->rx.addr)->sun_path;
 		snprintf(errmsg, errlen, "%s [%s]", msg, path);