diff --git a/src/proto_tcp.c b/src/proto_tcp.c index d872ed318..e59aa961c 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -774,6 +774,12 @@ static int tcp_suspend_receiver(struct receiver *rx) const struct sockaddr sa = { .sa_family = AF_UNSPEC }; int ret; + /* we never do that with a shared FD otherwise we'd break it in the + * parent process and any possible subsequent worker inheriting it. + */ + if (rx->flags & RX_F_INHERITED) + return -1; + if (connect(rx->fd, &sa, sizeof(sa)) < 0) goto check_already_done; diff --git a/src/proto_udp.c b/src/proto_udp.c index bebcfb363..0724680a9 100644 --- a/src/proto_udp.c +++ b/src/proto_udp.c @@ -206,6 +206,12 @@ static int udp_suspend_receiver(struct receiver *rx) if (rx->fd < 0) return 0; + /* we never do that with a shared FD otherwise we'd break it in the + * parent process and any possible subsequent worker inheriting it. + */ + if (rx->flags & RX_F_INHERITED) + return -1; + if (getsockname(rx->fd, (struct sockaddr *)&ss, &len) < 0) return -1;